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

Unable to exclude stacktrace from DataFormExceptions in OperationOutcomes when using JAX-RS providers #768

Closed
InfiniteLoop90 opened this issue Oct 22, 2017 · 1 comment

Comments

@InfiniteLoop90
Copy link
Contributor

InfiniteLoop90 commented Oct 22, 2017

In issue #111, stacktraces were supposed to not be included by default. In doing some digging, it looks like AbstractJaxRsProvider#createOutcome(DataFormatException) always includes the stacktrace in the details of the OperationOutcome. So if an invalid date format is sent for a DateParam, the whole stracktrace will be included in the response. It seems like it'd be idea if DataFormatExceptions would be handled like other exceptions by having the stacktrace be included if the Exception type is included as such in ExceptionHandlingInterceptor.
(Note, this issue still exists in the latest 3.1.0-SNAPSHOT build).

See screenshot from Postman for an example:
screen shot 2017-10-22 at 1 18 28 pm

InfiniteLoop90 added a commit to InfiniteLoop90/hapi-fhir that referenced this issue Oct 22, 2017
… when using AbstractJaxRsProviders, the stacktrace will be included in the OperationOutcome details only if AbstractJaxRsProvider#withStrackTrace() is configured to return true
InfiniteLoop90 added a commit to InfiniteLoop90/hapi-fhir that referenced this issue Oct 23, 2017
…tException as an InvalidRequestException so that it still gets sent as a 400 response but now DataFormatException stacktraces can now be conditionally sent based on the ExceptionHandlingInterceptor#setReturnStackTracesForExceptionTypes(Class<?>...) configuration
@InfiniteLoop90 InfiniteLoop90 changed the title Unable to exclude stacktrace from OperationOutcomes when using JAX-RS providers Unable to exclude stacktrace from DataFormExceptions in OperationOutcomes when using JAX-RS providers Oct 23, 2017
jamesagnew added a commit that referenced this issue Nov 23, 2017
…ace-jax-rs

Fixes issue #768 to conditionally include stacktraces for DataFormatExceptions in OperationOutcomes when using AbstractJaxRsProviders
@InfiniteLoop90
Copy link
Contributor Author

Closing since this was fixed in HAPI FHIR 3.1.0.

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

No branches or pull requests

1 participant