Package ca.uhn.fhir.model.dstu.resource.OperationOutcome

Examples of ca.uhn.fhir.model.dstu.resource.OperationOutcome.Issue


      theResponse.getWriter().write(e.getMessage());

    } catch (Throwable e) {

      OperationOutcome oo = new OperationOutcome();
      Issue issue = oo.addIssue();
      issue.getSeverity().setValueAsEnum(IssueSeverityEnum.ERROR);

      int statusCode = 500;
      if (e instanceof InternalErrorException) {
        ourLog.error("Failure during REST processing", e);
        issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
      } else if (e instanceof BaseServerResponseException) {
        ourLog.warn("Failure during REST processing: {}", e.toString());
        statusCode = ((BaseServerResponseException) e).getStatusCode();
        issue.getDetails().setValue(e.getMessage());
      } else {
        ourLog.error("Failure during REST processing", e);
        issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
      }

      streamResponseAsResource(this, theResponse, oo, determineResponseEncoding(theRequest), true, false, NarrativeModeEnum.NORMAL, statusCode, false);

      theResponse.setStatus(statusCode);
View Full Code Here


    if (errors.getAllErrors().containsOnlySuccess()) {
      return;
    }

    for (IResourceError next : errors.getAllErrors().getAllResourceErrors()) {
      Issue issue = theCtx.getOperationOutcome().addIssue();
      switch (next.getErrorLevel()) {
      case ERROR:
        issue.setSeverity(IssueSeverityEnum.ERROR);
        break;
      case FATAL_ERROR:
        issue.setSeverity(IssueSeverityEnum.FATAL);
        break;
      case WARN:
        issue.setSeverity(IssueSeverityEnum.WARNING);
        break;
      case INFO:
      case SUCCESS:
        continue;
      }

      issue.getDetails().setValue(next.getAsString(Locale.getDefault()));
    }

  }
View Full Code Here

        statusCode = ((BaseServerResponseException) e).getStatusCode();
      }

      if (oo == null) {
        oo = new OperationOutcome();
        Issue issue = oo.addIssue();
        issue.getSeverity().setValueAsEnum(IssueSeverityEnum.ERROR);
        if (e instanceof InternalErrorException) {
          ourLog.error("Failure during REST processing", e);
          issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
        } else if (e instanceof BaseServerResponseException) {
          ourLog.warn("Failure during REST processing: {}", e.toString());
          statusCode = ((BaseServerResponseException) e).getStatusCode();
          issue.getDetails().setValue(e.getMessage());
        } else {
          ourLog.error("Failure during REST processing", e);
          issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
        }
      }

      streamResponseAsResource(this, theResponse, oo, determineResponseEncoding(theRequest), true, requestIsBrowser, NarrativeModeEnum.NORMAL, statusCode, false, fhirServerBase);
View Full Code Here

    public MyErrorHandler(ValidationContext<?> theContext) {
      myContext = theContext;
    }

    private void addIssue(SAXParseException theException, IssueSeverityEnum severity) {
      Issue issue = myContext.getOperationOutcome().addIssue();
      issue.setSeverity(severity);
      issue.setDetails(theException.getLocalizedMessage());
      issue.addLocation().setValue("Line[" + theException.getLineNumber() + "] Col[" + theException.getColumnNumber() + "]");
    }
View Full Code Here

      theResponse.getWriter().write(e.getMessage());

    } catch (Throwable e) {

      OperationOutcome oo = new OperationOutcome();
      Issue issue = oo.addIssue();
      issue.getSeverity().setValueAsEnum(IssueSeverityEnum.ERROR);

      int statusCode = 500;
      if (e instanceof InternalErrorException) {
        ourLog.error("Failure during REST processing", e);
        issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
      } else if (e instanceof BaseServerResponseException) {
        ourLog.warn("Failure during REST processing: {}", e.toString());
        statusCode = ((BaseServerResponseException) e).getStatusCode();
        issue.getDetails().setValue(e.getMessage());
      } else {
        ourLog.error("Failure during REST processing", e);
        issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e));
      }

      streamResponseAsResource(this, theResponse, oo, determineResponseEncoding(theRequest), true, false, NarrativeModeEnum.NORMAL, statusCode, false, fhirServerBase);

      theResponse.setStatus(statusCode);
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.dstu.resource.OperationOutcome.Issue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.