asterisk / starpy

Python twisted library for AMI and FastAGI
Other
95 stars 61 forks source link

Exception AMICommandFailure with starpy dbGet when Database entry not found #17

Closed measterisk closed 10 years ago

measterisk commented 11 years ago

Change manager.py to handle a deferred function for the dbGet method when a "Resopnse: Error" is returned by AMI. This returns a None value on the dbGet callback.

This fixes an issue I had where an "Response: Error" to getDb would raise an error.AMICommandFailure(message) exception when the errorUnlessResponse method was called.

Also add a call deregisterEvent("DBGetResponse", extractValue) prior to the dbGet callbacks.

russellb commented 10 years ago

Is the exception wrong here? Isn't that what you'd expect if you get an error response?

Or is this patch actually making it consistent with error responses to other actions?

IgorrG commented 10 years ago

I have faced with same problem, this patch helps well.

Russell, in that situation I expect at least exception passed to onError callback, but currently exception not passed to callback.