Errors
Plant Applications microservices frequently return an error response for a REST request but often the standard HTTP status codes are insufficient to provide enough information for a user to correct the error. This section describes an example of a standard error response body structure for work-order-service that can be used to provide additional arbitrary details back to the user.
Detailed Error Response Format
The error response format consists of application/JSON data with the following fields:
Timestamp
(string) Timestamp of error in ISO8601 format.
Path (string) HTTP request path where the error occurred.
Error
(class) A single error structure consisting of the
following fields:
Code
(string) Enumeration value of the error classification or type.Details
(class) An optional class (could be null) containing arbitrary details about the specific error occurrence.
A user issuing a request that results in an error receives a response of the above format and expects a known Details structure for any given error Code. If the error is correctable, then the data stored within the Details provides sufficient knowledge required to correct the error and reissue the request. If the error is not correctable then the Details will be empty.