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

[BUG] Multiple REST APIs ignore the FlowFrameworkException status #293

Closed
dbwiddis opened this issue Dec 14, 2023 · 0 comments · Fixed by #295
Closed

[BUG] Multiple REST APIs ignore the FlowFrameworkException status #293

dbwiddis opened this issue Dec 14, 2023 · 0 comments · Fixed by #295
Assignees
Labels
bug Something isn't working v2.12.0

Comments

@dbwiddis
Copy link
Member

What is the bug?

Multiple RestActions catch the FlowFrameworkException but then ignore its status using ExceptionsHelper:

FlowFrameworkException ex = new FlowFrameworkException(exception.getMessage(), ExceptionsHelper.status(exception));
XContentBuilder exceptionBuilder = ex.toXContent(channel.newErrorBuilder(), ToXContent.EMPTY_PARAMS);
channel.sendResponse(new BytesRestResponse(ex.getRestStatus(), exceptionBuilder));

How can one reproduce the bug?

  1. Call an impacted REST API (e.g., GET workflow)
  2. Observe the correct exception message but an incorrect 500 RestStatus.

What is the expected behavior?

The RestStatus from the FlowFrameworkException is returned.

Do you have any additional context?

I've addressed this in PR #271 by changing the first line above to:

FlowFrameworkException ex = exception instanceof FlowFrameworkException
    ? (FlowFrameworkException) exception
    : new FlowFrameworkException(exception.getMessage(), ExceptionsHelper.status(exception));

That needs to be copied over to all the other REST handlers.

Suggest this bug is addressed at the same time as #292 and #274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.12.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant