Issue Details (XML | Word | Printable)

Key: JERSEY-1468
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Michal Gajdos
Reporter: jan.supol
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jersey

Jersey prints error stack trace instead of throwing the error from Response#readEntity()

Created: 11/Oct/12 04:11 PM   Updated: 01/Nov/12 10:21 AM   Resolved: 01/Nov/12 10:21 AM
Component/s: core
Affects Version/s: 2.0-m08
Fix Version/s: 2.0-m10, 2.0

Time Tracking:
Original Estimate: 3 hours
Original Estimate - 3 hours
Remaining Estimate: 0 minutes
Time Spent: 1 minute
Time Not Required

Tags:
Participants: jan.supol and Michal Gajdos


 Description  « Hide
class Interceptor implements ReaderInterceptor{
	@Override
	public Object aroundReadFrom(ReaderInterceptorContext ctx)
			throws IOException, WebApplicationException {
		throw new IOException("error");
	}
}

response = invocation.invoke();
String entity = response.readEntity(String.class);

I throw the exception in the ReaderInterceptor, but
readEntity (InboundMessageContext) prints the stack trace of the IOException and returns the original entity.

Java has no way to get know the Exception occurred, i.e. there is no programatic way to get know the Exception occurred in the interceptor. Also, the throwing of IOException in the interceptor has no meaning this way. Better way to do this is the way it is done in bufferEntity, where IOException is encapsulated in MessageProcessingException.



There are no comments yet on this issue.