sangoma / switchy

async FreeSWITCH cluster control
https://switchy.readthedocs.io/en/latest/
Mozilla Public License 2.0
69 stars 18 forks source link

`Connection.api` calls should throw error on failure #8

Closed goodboy closed 7 years ago

goodboy commented 9 years ago

Currently any api call to a switchy.Connection does not report errors if the command was unsuccessful. This can be a problem for example with sessions which are operated on in a Switchy app such that failed method calls are never reported as errors.

A simple example can be seen here: https://github.com/sangoma/switchy/blob/master/switchy/models.py#L232 If the uuid corresponding to the current session no longer exists (and thus no dtmf is transmitted) there will be a silent failure. The user may be left wondering why no dtmf was transmitted when in reality the Session was already torn down for some other reason.