Skip to content

Conversation

@bergundy
Copy link
Contributor

@bergundy bergundy commented Aug 5, 2025

  1. Add cause and stackTrace attributes to Failure
  2. Document HandlerError
  3. Document OperationError
  4. Add the CONFLICT handler error type
  5. Add the REQUEST_TIMEOUT handler error type
  6. Remove mentions of response codes that are covered by handler error types
  7. Deprecate the Nexus-Request-Retryable and Nexus-Operation-State headers since this information should be present in the response body.

SPEC.md Outdated
| `UNAUTHENTICATED` | 401 | The client did not supply valid authentication credentials for this request. Clients should not retry this request unless advised otherwise. |
| `UNAUTHORIZED` | 403 | The caller does not have permission to execute the specified operation. Clients should not retry this request unless advised otherwise. |
| `NOT_FOUND` | 404 | The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible but not advised. |
| `CONFLICT` | 409 | The request could not be made due to a conflict. The may happen when trying to create an operation that has already been started. Clients should not retry this request unless advised otherwise. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also have 408 timeout in this table?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating but decided against it since I didn't want handlers to return this directly. Let's see if others have opinions here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should include it for completeness. I remember some internal confusion about the purpose of that response code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"type": "nexus.OperationError",
},
"message": "<Optional error message>",
"stackTrace": "<Optional stack trace>",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we supporting stack trace and message encryption?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment below: "Arbitrary details may be added here as needed."

Copy link

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to get some eyes @dandavison @cretz or @mjameswh t make sure this will address their issues with the previous approach

@cretz
Copy link

cretz commented Aug 12, 2025

I haven't really had time to look, but so long as handler errors/exceptions can be like any other failure (with messages and stack traces and causes instead of just causes), works for me.

@bergundy bergundy force-pushed the additional-failure-attributes branch from 019c09d to a2d914d Compare October 10, 2025 18:54
@bergundy bergundy force-pushed the additional-failure-attributes branch from a2d914d to a2addbd Compare October 10, 2025 18:54
@bergundy bergundy merged commit dc20558 into nexus-rpc:main Oct 10, 2025
1 check passed
@bergundy bergundy deleted the additional-failure-attributes branch October 10, 2025 21:56
bergundy added a commit to nexus-rpc/sdk-go that referenced this pull request Oct 13, 2025
Implements the changes mentioned in
nexus-rpc/api#21.
I've added tests in the last commit that should not be merged, they are
used to test current main server and client against this version to
ensure compatibility.
Note that backwards compatibility is only ensured if an error includes
only `Cause` or `Message` but not both, but that is okay as the new
`Message` field is an addition.

I will wait on merging this until the transport refactor is in to avoid
merge conflicts in that branch.
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 participants