ExceptionReportDocument exceptionReportDoc = ExceptionReportDocument.Factory.newInstance(); ExceptionReport exceptionReport = exceptionReportDoc.addNewExceptionReport(); ExceptionType exception = exceptionReport.addNewException(); exception.setLocator("NoApplicableCode"); exception.addExceptionText(t.getMessage());
public ExceptionReportDocument getExceptionDocument() { // Printing serivce Exception ExceptionReportDocument report = ExceptionReportDocument.Factory.newInstance(); net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport exceptionReport = report.addNewExceptionReport(); //Fix for Bug 903 https://bugzilla.52north.org/show_bug.cgi?id=903 exceptionReport.setVersion("1.0.0"); ExceptionType ex = exceptionReport.addNewException(); ex.setExceptionCode(errorKey); ex.addExceptionText(this.getMessage()); // Adding additional Java exception ExceptionType stackTrace = exceptionReport.addNewException(); stackTrace.addExceptionText(encodeStackTrace(this)); stackTrace.setExceptionCode("JAVA_StackTrace"); // adding Rootcause ExceptionType stackTraceRootException = exceptionReport.addNewException(); if (getCause() != null) { stackTraceRootException.addExceptionText(getCause().getMessage()); stackTraceRootException.addExceptionText(encodeStackTrace(getCause())); } stackTraceRootException.setExceptionCode("JAVA_RootCause"); if (locator != null) { ex.setLocator(locator); } return report; }
private XmlBeansServiceException(OwsException owsException) { exceptionDocument = ExceptionReportDocument.Factory.newInstance(); ExceptionReport report = exceptionDocument.addNewExceptionReport(); ExceptionType exceptionType = report.addNewException(); setExceptionContent(owsException, exceptionType); }
private void setOwsExceptions(ExceptionReport report, OwsExceptionReport owsExceptionReport) { for (OwsException owsException : owsExceptionReport.getOwsExceptionsArray()) { setExceptionContent(owsException, report.addNewException()); } }
private void setOwsExceptions(ExceptionReport report, OwsExceptionReport owsExceptionReport) { for (OwsException owsException : owsExceptionReport.getOwsExceptionsArray()) { setExceptionContent(owsException, report.addNewException()); } }
public void updateStatusError(String errorMessage) { StatusType status = StatusType.Factory.newInstance(); net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport excRep = status .addNewProcessFailed().addNewExceptionReport(); excRep.setVersion("1.0.0"); ExceptionType excType = excRep.addNewException(); excType.addNewExceptionText().setStringValue(errorMessage); excType.setExceptionCode(ExceptionReport.NO_APPLICABLE_CODE); updateStatus(status); }
private ServiceException(OwsException owsException) { exceptionDocument = ExceptionReportDocument.Factory.newInstance(); ExceptionReport report = exceptionDocument.addNewExceptionReport(); ExceptionType exceptionType = report.addNewException(); setExceptionContent(owsException, exceptionType); }