Creates an error instance and assigns its values.
human-readable error or locator of the component that cannot be created.
Defines what category of exceptions this exception belongs to.
Additional information about the cause of the exception.
Every error needs a unique code by which it can be identified. Using this code, we can select which localized error messages to use and what to display in the UI.
Unique business transaction id to trace calls across components. Important field for microservices, as it allows us to tie an exception to a specific business transaction.
This field is used to add additional information to localized error message strings.
For example, if we received an ObjectNotFoundException (general error) when searching for an object via its id, the id by which the object was not found can be added as a detail. This allows us to add additional details to localized error messages. Resulting error message format: “(Localized error's text) - id: (id)”
This field stores the message or description that was contained in the original error. Errors' messages are always in English. However, using this class's 'code' and 'details' fields, we can create localized versions of the error's message and use them instead in the UI.
Stack trace of the exception.
Used when sending over the REST interface, so that we know what HTTP status code to raise.
Returns additional information about the cause of the exception.
Returns the stack trace of the exception.
Sets additional information about the cause of the exception.
Sets the stack trace of the exception.
Sets the cause of the exception and returns the resulting ApplicationException. The 'cause' field contains additional information about the cause of the exception.
Sets the code of the exception and returns the resulting ApplicationException. Every error needs a unique code by which it can be identified. Using this code, we can select which localized error messages to use and what to display in the UI.
Sets the correlation ID of the exception and returns the resulting ApplicationException. The correlation ID ties an exception to a specific business transaction.
Sets the details of the exception and returns the resulting ApplicationException. Details are used to add additional information to localized error message strings.
Sets the stack trace of the exception and returns the resulting ApplicationException.
Sets the status of the exception and returns the resulting ApplicationException. The 'status' field is used when sending exceptions over the REST interface, so that we know what HTTP status code to raise.
Wrapping allows us to transform general exceptions into ApplicationExceptions.
This method does the following:
The third point of this list is used in the following way: when an unknown exception is raised, the exception's type can be determined, a category of ApplicationExceptions that is closest to the exception's type can be chosen from the ones available, after which the unknown exception can be wrapped around the chosen type of ApplicationException. This is done for unifying exceptions, as it is challenging to process a wide variety of unknown exceptions. Wrapping unknown exceptions around existing ones allows us to categorize them and be "in the ballpark".
the exception that is to be wrapped around this ApplicationException object.
the 'cause' parameter as an ApplicationException (if it is one) or this ApplicationException object with 'this.cause' set to the 'cause' parameter's 'message' field.
Used to unwrap Seneca exceptions and restify exceptions.
error that may contain Seneca or restify exceptions.
For Seneca exceptions: error.orig. For restify exceptions: error.body.
Static method that is identical to the non-static method wrap. Wraps 'cause' around the ApplicationException passed as 'error', instead of itself (this).
ApplicationException that has been chosen for wrapping.
the exception that is to be wrapped around the 'error' parameter.
the 'cause' parameter as an ApplicationException (if it is one) or the parameter 'error' with its 'cause' field set to the 'cause' parameter's 'message' field.
Generated using TypeDoc
Error raised when factory is not able to create requested component.
InternalException (in the PipServices "Commons" package)
ApplicationException (in the PipServices "Commons" package)