Skip to content

#194 4.34 — Error response standardization (RFC 7807)#258

Open
Chigybillionz wants to merge 2 commits intodetermined-001:mainfrom
Chigybillionz:error-response
Open

#194 4.34 — Error response standardization (RFC 7807)#258
Chigybillionz wants to merge 2 commits intodetermined-001:mainfrom
Chigybillionz:error-response

Conversation

@Chigybillionz
Copy link
Copy Markdown

Linked issue

Closes #194

Changes

New File: errors.ts

  • Created ProblemDetails interface with fields:
    • type: Machine-readable error identifier (URI)
    • title: Short human-readable summary
    • status: HTTP status code
    • detail: Specific explanation for this occurrence
    • instance: Optional unique identifier for this error
  • Implemented sendProblem() helper function that:
    • Sets Content-Type: application/problem+json
    • Auto-generates type URIs (e.g., "invalid-stellar-key" from "Invalid Stellar Key")
    • Allows custom type and instance URIs if needed

Modified: routes.ts

  • Added import of sendProblem helper
  • Replaced all 7 error sites with RFC 7807 responses:
    • POST /webhooks/register: Missing/invalid fields, invalid Stellar key, invalid URL, duplicate address
    • DELETE /webhooks/:address: Address not found
    • GET /webhooks/:address: Address not found

Modified: README.md

  • Added "Error responses" section documenting:
    • RFC 7807 compliance
    • Error response shape with field descriptions
    • Example error response
    • Table of common error responses with status codes and descriptions

Done When

✅ All error responses follow RFC 7807 with Content-Type: application/problem+json
✅ Consistent error structure across all endpoints
✅ Machine-readable error types for client-side handling
✅ Error responses documented in README

Files Changed

  • errors.ts (new)
  • routes.ts (modified)
  • README.md (modified)

thank you!

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@Chigybillionz is attempting to deploy a commit to the determined's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@Chigybillionz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@determined-001
Copy link
Copy Markdown
Owner

Thanks for the contribution! Merging now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.34 — Error response standardization (RFC 7807)

2 participants