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
[WFCORE-189] Provide a proper detail message when creating an OFE #255
Conversation
Looks fine to me |
@@ -78,7 +78,7 @@ public void execute(OperationContext context, ModelNode operation) throws Operat | |||
} | |||
} | |||
catch (IOException e) { | |||
throw new OperationFailedException(new ModelNode().set(e.toString())); | |||
throw new RuntimeException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be very important, but why the changed type of exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kabir thanks for asking, as I'd like a second opinion. And I shouldn't have made this change here anyway, as it's a bit OT to the overall PR.
I changed it because OFE is meant to represent a client failure, not a server fault. And I don't see how an IOException is a client failure.
OTOH...
- the standalone variant of this throws OFE, so these should be consistent one way or the other
org.jboss.as.server.deployment.AbstractDeploymentUploadHandler
catch (IOException e) {
throw ServerLogger.ROOT_LOGGER.caughtIOExceptionUploadingContent(e);
}
- the basic difference between RuntimeException and OFE is the former will end up in the server log. Also, if we end up providing proper HTTP response codes, the former will result in a 500 while the latter will result in a 400. But for both of those issues, maybe the OFE result is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to switch it back to an OFE, built the same as the standalone variant.
456e321
to
7868200
Compare
7868200
to
c6c0fc7
Compare
[WFCORE-189] Provide a proper detail message when creating an OFE
No description provided.