Package ca.uhn.model.json

Examples of ca.uhn.model.json.Error


    String error = cause.getMessage();
    error = (null == error) ? "Unknown error" : error;

    if (cause instanceof InvalidParamsException) {
      log.error(cause.getMessage());
      return gson.toJson(new Error(error, Error.INVALID_PARAMS));
    } else if (cause instanceof MethodNotFoundException) {
      log.error(cause.getMessage());
      return gson.toJson(new Error(error, Error.METHOD_NOT_FOUND));
    } else if (cause instanceof InternalErrorException) {
      log.error("Internal Error", cause);
      return gson.toJson(new Error(error, Error.INTERNAL_ERROR));
    } else if (cause instanceof AuthorizationErrorException) {
      log.error("Authorization Error", cause);
      return gson.toJson(new Error(error, Error.AUTHORIZATION_ERROR));
    } else if (cause instanceof LimitReachedException) {
      log.error("Max records limit reached", cause);
      return gson.toJson(new Error(error, Error.LIMIT_REACHED_ERROR));
    }
    else {
      log.error("Unknown error occurred while processing the request", cause);
      return gson.toJson(new Error(error, Error.FATAL));
    }
  }
View Full Code Here

TOP

Related Classes of ca.uhn.model.json.Error

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.