/** * Handle an invocation target exception. * * @param e Exception the exception encountered while reflecting on an object's field * @return Equivalent runtime exception */ private static RuntimeException handleInvocationTargetException(InvocationTargetException e) { Throwable exception = e.getTargetException(); if (exception instanceof HttpStatusException || exception instanceof WebApplicationException) { return (RuntimeException) exception; } log.error("Caught an unexpected exception (rethrowing as internal server error)", e); return new InternalServerErrorException("Unexpected exception caught", e); }
/** * Handle an invocation target exception. * * @param e Exception the exception encountered while reflecting on an object's field * @return Equivalent runtime exception */ private static RuntimeException handleInvocationTargetException(InvocationTargetException e) { Throwable exception = e.getTargetException(); if (exception instanceof HttpStatusException || exception instanceof WebApplicationException) { return (RuntimeException) exception; } log.error("Caught an unexpected exception (rethrowing as internal server error)", e); return new InternalServerErrorException("Unexpected exception caught", e); }
throw new InvalidEntityBodyException(mapper.writeJsonApiDocument(doc)); } catch (JsonProcessingException e) { throw new InternalServerErrorException(e);
inverseResource.setValueChecked(inverseName, this.getObject()); } else { throw new InternalServerErrorException("Relationship type mismatch");
throw new InvalidEntityBodyException(mapper.writeJsonApiDocument(doc)); } catch (JsonProcessingException e) { throw new InternalServerErrorException(e);
inverseResource.setValueChecked(inverseName, this.getObject()); } else { throw new InternalServerErrorException("Relationship type mismatch");
inverseResource.nullValue(inverseField, this); } else { throw new InternalServerErrorException("Relationship type mismatch");
inverseResource.nullValue(inverseField, this); } else { throw new InternalServerErrorException("Relationship type mismatch");