ErrorDetail provides details about a specific error.
| 15 | |
| 16 | // ErrorDetail provides details about a specific error. |
| 17 | type ErrorDetail struct { |
| 18 | // Message is a human-readable explanation of the error. |
| 19 | Message string `json:"message,omitempty" doc:"Error message text"` |
| 20 | |
| 21 | // Location is a path-like string indicating where the error occurred. |
| 22 | // It typically begins with `path`, `query`, `header`, or `body`. Example: |
| 23 | // `body.items[3].tags` or `path.thing-id`. |
| 24 | Location string `json:"location,omitempty" doc:"Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'"` |
| 25 | |
| 26 | // Value is the value at the given location, echoed back to the client |
| 27 | // to help with debugging. This can be useful for e.g. validating that |
| 28 | // the client didn't send extra whitespace or help when the client |
| 29 | // did not log an outgoing request. |
| 30 | Value any `json:"value,omitempty" doc:"The value at the given location"` |
| 31 | } |
| 32 | |
| 33 | // Error returns the error message / satisfies the `error` interface. If a |
| 34 | // location and value are set, they will be included in the error message, |
nothing calls this directly
no outgoing calls
no test coverage detected