Package ca.uhn.fhir.rest.server.exceptions

Examples of ca.uhn.fhir.rest.server.exceptions.InternalErrorException


    Object response;
    try {
      response = getMethod().invoke(theResourceProvider, params);
    } catch (Exception e) {
      throw new InternalErrorException("Failed to call access method", e);
    }

    return toResourceList(response);
  }
View Full Code Here


   
    Object response;
    try {
      response = getMethod().invoke(theResourceProvider, args);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (IllegalArgumentException e) {
      throw new InternalErrorException(e);
    } catch (InvocationTargetException e) {
      throw new InternalErrorException(e);
    }
   
    return toResourceList(response);
  }
View Full Code Here

    MethodOutcome response;
    try {
      response = (MethodOutcome) this.getMethod().invoke(getProvider(), params);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (IllegalArgumentException e) {
      throw new InternalErrorException(e);
    } catch (InvocationTargetException e) {
      throw new InternalErrorException(e);
    }

    if (response == null) {
      if (myReturnVoid == false) {
        throw new ConfigurationException("Method " + getMethod().getName() + " in type " + getMethod().getDeclaringClass().getCanonicalName() + " returned null");
View Full Code Here

      break;
    case RESOURCE:
      if (result.size() == 0) {
        throw new ResourceNotFoundException(theRequest.getId());
      } else if (result.size() > 1) {
        throw new InternalErrorException("Method returned multiple resources");
      }
      streamResponseAsResource(theServer, theResponse, result.get(0), responseEncoding, prettyPrint, requestIsBrowser, narrativeMode);
      break;
    }
  }
View Full Code Here

        return null;
      } else {
        return (IdDt) retValObj;
      }
    }
    throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + IdDt.class.getCanonicalName());
  }
View Full Code Here

        return null;
      } else {
        return (InstantDt) retValObj;
      }
    }
    throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName());
  }
View Full Code Here

            b.append('/');
            b.append(Constants.PARAM_HISTORY);
            b.append('/');
            b.append(versionId.getValue());
          } else {
            throw new InternalErrorException("Server did not provide a VERSION_ID in the resource metadata for resource with ID " + resId);
          }
        }

        InstantDt published = getInstantFromMetadataOrNullIfNone(next.getResourceMetadata(), ResourceMetadataKeyEnum.PUBLISHED);
        if (published == null) {
View Full Code Here

    Object response;
    try {
      response = this.getMethod().invoke(theResourceProvider, params);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (IllegalArgumentException e) {
      throw new InternalErrorException(e);
    } catch (InvocationTargetException e) {
      Throwable cause = e.getCause();
      if (cause != null) {
        if (cause instanceof BaseServerResponseException) {
          throw (BaseServerResponseException)cause;
        } else {
          throw new InternalErrorException(cause);
        }
      }
      throw new InternalErrorException(e);
    }

    return toResourceList(response);

  }
View Full Code Here

    MethodOutcome response;
    try {
      response = (MethodOutcome) this.getMethod().invoke(getProvider(), params);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (IllegalArgumentException e) {
      throw new InternalErrorException(e);
    } catch (InvocationTargetException e) {
      throw new InternalErrorException(e);
    }

    if (response == null) {
      if (isReturnVoid() == false) {
        throw new ConfigurationException("Method " + getMethod().getName() + " in type " + getMethod().getDeclaringClass().getCanonicalName() + " returned null");
View Full Code Here

      for (Object next : ((Collection<?>) response)) {
        retVal.add((IResource) next);
      }
      return retVal;
    } else {
      throw new InternalErrorException("Unexpected return type: " + response.getClass().getCanonicalName());
    }
  }
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.rest.server.exceptions.InternalErrorException

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.