Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexus: Well know error translation #2242

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

Translate some well know errors like what we did with the Go SDK. This does not cover all possible SDK exception, just some we except users to throw in this initial release.

closes #2209

@@ -59,7 +59,6 @@ private static String getMessage(WorkflowExecution execution, String workflowTyp
+ execution.getWorkflowId()
+ "', runId='"
+ execution.getRunId()
+ (workflowType == null ? "" : "', workflowType='" + workflowType + '\'')
+ '}';
+ (workflowType == null ? "" : "', workflowType='" + workflowType + '\'');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what this random } was for

throw new OperationHandlerException(
OperationHandlerException.ErrorType.INTERNAL, failure.getMessage());
}
if (failure instanceof WorkflowException) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you confirm that this roughly maps to WorkflowExecutionError or QueryRejectedError in Go?

This is fine as an initial first pass at this but I think eventually we may want a different approach. We'll see if we get any feedback on the current approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WorkflowQueryException and WorkflowFailedException extend WorkflowException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So they are both treated as BAD_REQUEST

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 86e9b87 into temporalio:nexus Oct 2, 2024
7 checks passed
Quinn-With-Two-Ns added a commit that referenced this pull request Oct 3, 2024
Add conversion for common errors
Quinn-With-Two-Ns added a commit to Quinn-With-Two-Ns/sdk-java that referenced this pull request Oct 11, 2024
Quinn-With-Two-Ns added a commit that referenced this pull request Oct 15, 2024
Add conversion for common errors
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.

2 participants