Errors
Any failure in the Client Library is reported as a FncClientError
. This class extends the Exception class and can be imported from fnc.errors
. The exact reason of the failure could be distinguished by looking into its internal fields.
Field |
Type |
Description |
---|---|---|
error_type |
ErrorType |
This field will contain the specific type of error that cause the failure. The complete list can be found in the appendix FncClient Library Error Types. In case of any unexpected exception a |
error_message |
String |
A meaningful error message specific to the error type is included in this field. This message will contain relevant information (i.e., misconfigured values) if any. |
error_data |
Dict |
This field is a dictionary of the information, relevant to the specific error, required to create the error message. |
exception |
Exception |
If an exception was received and wrapped into a |
Sample Code:
class FncClientError(Exception): error_type: ErrorType error_message: str error_data: dict exception: Exception def get_original_exception(self):