dripline.core.throw_reply module¶
-
exception
dripline.core.throw_reply.
ThrowReply
(return_code=<_dripline.core.DL_Success object>, message='Success', payload=<scarab.Param object>)[source]¶ Bases:
Exception
Exception class for use throughout the codebase for exceptions which do not fatally interrupt a running dripline service. These exceptions are caught in the top of the message handling call stack and result in an reply message being sent indicating an error. The preferred way to send a reply indicating an error (or warning) is to raise an instance of ThrowReply. In cases where a dependency library throws a custom exception, or any piece of code throws a standard python exception, if the expected behavior is an error reply and continued service operation, that exception must be handled and ThrowReply raised instead.
- Parameters
return_code (_dripline.core.ReturnCode || string) – instance of subclass of ReturnCode, or the string name of a return code; it must be an instance which is already registered and is used to determine various header fields of the resulting dripline message.
message (string) – provides more specific information about the particular exception (beyond the fixed ReturnCode’s description
payload (scarab.Param) – any data to include in the payload of the reply message (in a Warning, should match the normal success data)