|
Pythomnic » Documentation » Error handling
Pythomnic error-handling strategy is influenced with the nature of
its application - processing separate synchronous requests incoming
from different interfaces.
Essentially, an exception unhandled in
your application code propagates up to the interface which has
initiated the request, where it is caught, wrapped up and delivered
with the response using the interface-specific mechanism. This is
easier to demonstrate with a web service, for example if an HTTP
request fails, the client gets a "500 Internal server error" response
with a chunk of text similar to this:
UnboundLocalError("local variable 'undefined' referenced before assignment")
in incoming_request() (http_interface_receiver.py:27)
<- takes_invocation_proxy() (typecheck.py:379)
<- __call__() (module_loader.py:764)
<- _handle_request() (http_interface.py:80)
With a message-oriented interface, such as JMS, the protocol doesn't support
responses, therefore the interface simply writes the exception text to the log file
and aborts the message processing by rolling back the receiving transaction.
|
Features Download Documentation Tutorial |