@backstage/errors
Common utilities for error handling within Backstage
Classes
Class |
Description |
---|---|
The request requires authentication, which was not properly supplied. | |
The request could not complete due to a conflict in the current state of the resource. | |
A base class that custom Error classes can inherit from. | |
An error that forwards an underlying cause with additional context in the message. The | |
The given inputs are malformed and cannot be processed. | |
The authenticated caller is not allowed to perform this request. | |
The requested resource could not be found. Note that this error usually is used to indicate that an entity with a given ID does not exist, rather than signalling that an entire route is missing. | |
The server does not support the functionality required to fulfill the request. | |
The requested resource has not changed since last request. | |
An error thrown as the result of a failed server request. The server is expected to respond on the ErrorResponseBody format. | |
The server is not ready to handle the request. |
Functions
Function |
Description |
---|---|
Asserts that an unknown value is an ErrorLike object, which guarantees that it's an object that has at least two string properties: a non-empty If the value is not an ErrorLike object, an error is thrown. | |
Deserializes a serialized error object back to an Error. | |
Checks whether an unknown value is an ErrorLike object, which guarantees that it's an object that has at least two string properties: a non-empty | |
Attempts to construct an ErrorResponseBody out of a failed server request. Assumes that the response has already been checked to be not ok. This function consumes the body of the response, and assumes that it hasn't been consumed before. The code is forgiving, and constructs a useful synthetic body as best it can if the response body wasn't on the expected form. | |
Serializes an error object to a JSON friendly form. | |
Stringifies an error, including its name and message where available. |
Type Aliases
Type Alias |
Description |
---|---|
ConsumedResponse represents a Response that is known to have been consumed. The methods and properties used to read the body contents are therefore omitted. | |
An object that is shaped like an | |
A standard shape of JSON data returned as the body of backend errors. | |
The serialized form of an Error. |