Coverage for ion/core/exception : 100.00%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#!/usr/bin/env python
@file ion/core/exception.py @author Michael Meisinger @brief module for exceptions """
""" Raise this exception from within a process/service op_ method when things go really wrong for you. This gives you the ability to "fail quickly"; the container will die, and it's monitoring system can take action to start a replacement. """
# User-defined Exceptions should be derived from Exception pass
# @todo Some better str output
pass
pass
pass
pass
pass
pass
pass
""" @Brief An Exception class for use in service business logic which will not result in the service being terminated. Any exception thrown which is not a subclass of Application Error will cause the process to terminate. """
""" @param reason a string explaining the cause of the exception @param response_code is an http style numerical error code. These are defined in the ION Message When this exception is used in RPC messaging, a 400 level code will result in a ReceivedApplicationError in the originating process. A 500 level code will result in a ReceivedContainerError. """
# Set up the exception
# Set the response code
""" An exception to throw when a 5XX response code is received during RPC messaging """
""" An exception to throw for 4XX response code is received during RPC messaging """
#class ReceivedError(IonError): # # def __init__(self, *args, **kwargs): # if len(args) == 2 and type(args[0]) is dict and type(args[1]) is dict: # headers = args[0] # content = args[1] # self.msg_headers = headers # self.msg_content = content # msg = content.get('errmsg', "ERROR received in message") # IonError.__init__(self, msg) # else: # IonError.__init__(self, *args, **kwargs) |