In QuotasResource.listQuotas() and UsagesResource.listUsages(), errors are manually thrown within a containing
try {} blocks, which are getting caught by the containing block, thereby causing the wrong exception type to be
returned, for example:
So, if x is true, 'Response.Status.FORBIDDEN' should be returned, but instead 'Response.Status.INTERNAL_SERVER_ERROR' gets returned.
Maybe the easiest way to fix this is to catch 'WebApplicationException' in the containing block and just re-throw it, or
perhaps instead of catching 'Exception' in the outer block, catching expected errors.
In QuotasResource.listQuotas() and UsagesResource.listUsages(), errors are manually thrown within a containing
try {}
blocks, which are getting caught by the containing block, thereby causing the wrong exception type to be returned, for example:So, if x is true, 'Response.Status.FORBIDDEN' should be returned, but instead 'Response.Status.INTERNAL_SERVER_ERROR' gets returned.
Maybe the easiest way to fix this is to catch 'WebApplicationException' in the containing block and just re-throw it, or perhaps instead of catching 'Exception' in the outer block, catching expected errors.
Suggestions?