solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.07k stars 437 forks source link

RFC7807 #8382

Open asayah opened 1 year ago

asayah commented 1 year ago

Version

None

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Currently we are using RFC7807 https://www.rfc-editor.org/rfc/rfc7807 as the way to do our errors. Our current Gateway has an error handler that checks the error contents against the RFC7807 spec and if it passes, lets the error through and if not, does a minimal attempt to remedy the situation. A standard RFC7807 error on our side looks like this: { "title": "Unsupported Media Type", "detail": "Example detailed information", "code": 62, "type": "https://services.docs.unity.com/docs/errors/index.html#62", "status": 400, "details": [] } Note that the code is not default, but the standard allows additional fields. In our case, if we receive a “faulty” error from backend, we check if the error already has some of those fields and move them into the RFC7807 error we return. The main purpose for this for us is to

  1. Avoid sending stacktrace information that backends may dump our way if they have faulty code.
  2. Ensure consistent errors across the entire company for SDKs and other clients.

Describe alternatives you've considered

No response

Additional Context

No response

github-actions[bot] commented 3 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.