use of org.n52.janmayen.exception.LocationHintException in project arctic-sea by 52North.
the class KvpBinding method toOwsExceptionReport.
private OwsExceptionReport toOwsExceptionReport(Throwable ex) {
if (ex instanceof OwsExceptionReport) {
return (OwsExceptionReport) ex;
}
Throwable cause = ex.getCause();
if (cause instanceof OwsExceptionReport) {
return (OwsExceptionReport) cause;
}
if (ex instanceof CompositeException) {
return toOwsExceptionReport((CompositeException) ex);
}
if (cause instanceof CompositeException) {
return toOwsExceptionReport((CompositeException) cause);
}
String location = null;
if (ex instanceof LocationHintException) {
location = ((LocationHintException) ex).getLocation().orElse(null);
} else if (cause instanceof LocationHintException) {
location = ((LocationHintException) cause).getLocation().orElse(null);
}
return new InvalidParameterValueException().withMessage(ex.getMessage()).causedBy(ex).at(location);
}
Aggregations