Skip to content

error response #6

@tinfoilhash

Description

@tinfoilhash

errors optionally returning a X-Reason header without a response body feels... out of the ordinary? i also don't think it'll scale well or provide the best developer experience.

if the protocol is leaning into json, why not return errors as json? example:

{
  "error": "pov_required",
  "message": "Algorithm 'for-you' requires a pov."
}
  1. additional fields can be added more easily than entirely new headers.
  2. it's much more common to log or convert the response to an error object than pick out specific headers.
  3. X-Reason would have to be exposed for cors.
  4. idea: i've found a machine-readable error code of sorts to be helpful in discriminating between different errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions