Skip to content

Error code 40300 used for both 'promise resolved' and 'unauthorized prefix' #1014

@flossypurse

Description

@flossypurse

Summary

Error code 40300 is being used for multiple unrelated error conditions, causing confusion when debugging.

Observed behavior

When a JWT token has a prefix claim that doesn't match the promise ID being accessed, the server returns:

{
  "error": {
    "code": 40300,
    "message": "The request is forbidden",
    "details": [{
      "@type": "ServerError",
      "message": "unauthorized prefix",
      "domain": "server",
      "metadata": {
        "url": "https://docs.resonatehq.io/operate/errors#40300"
      }
    }]
  }
}

Documentation says

40300 - The promise has already been resolved. Once a promise is resolved it can no longer be modified.

Problem

Two unrelated conditions share the same error code:

  1. Promise already resolved (immutability constraint)
  2. Unauthorized prefix (auth/permission issue)

Suggestion

Consider using distinct error codes:

  • 40300 - Promise already resolved
  • 40301 or 40310 - Unauthorized prefix (or similar auth-related code)

Impact

Developers debugging JWT auth issues are directed to docs about resolved promises, which is confusing and slows down troubleshooting.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions