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

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


    IQueryParameterAnd dt;
    try {
      dt = myType.newInstance();
      dt.setValuesAsQueryTokens(theString);
    } catch (InstantiationException e) {
      throw new InternalErrorException(e);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (SecurityException e) {
      throw new InternalErrorException(e);
    }
    return dt;
  }
View Full Code Here


        throw new InvalidRequestException("Multiple values detected");
      }
     
      dt.setValuesAsQueryTokens(theString.get(0));
    } catch (InstantiationException e) {
      throw new InternalErrorException(e);
    } catch (IllegalAccessException e) {
      throw new InternalErrorException(e);
    } catch (SecurityException e) {
      throw new InternalErrorException(e);
    }
    return dt;
  }
View Full Code Here

        return (IdDt) retValObj;
      }
    } else if (retValObj instanceof Number) {
      return new IdDt(((Number)retValObj).toString());
    }
    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

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

      return method.invoke(getProvider(), theMethodParams);
    } catch (InvocationTargetException e) {
      if (e.getCause() instanceof BaseServerResponseException) {
        throw (BaseServerResponseException) e.getCause();
      } else {
        throw new InternalErrorException("Failed to call access method", e);
      }
    } catch (Exception e) {
      throw new InternalErrorException("Failed to call access method", e);
    }
  }
View Full Code Here

      for (Object next : ((Collection<?>) response)) {
        retVal.add((IResource) next);
      }
      return BundleProviders.newList(retVal);
    } else {
      throw new InternalErrorException("Unexpected return type: " + response.getClass().getCanonicalName());
    }
  }
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");
      }

      IResource resource = result.getResources(0, 1).get(0);

      for (int i = theServer.getInterceptors().size() - 1; i >= 0; i--) {
View Full Code Here

    for (int i = 0; i < retResources.size(); i++) {
      IdDt oldId = oldIds.get(retResources.get(i));
      IResource newRes = retResources.get(i);
      if (newRes.getId() == null || newRes.getId().isEmpty()) {
        if (!(newRes instanceof OperationOutcome)) {
          throw new InternalErrorException("Transaction method returned resource at index " + i + " with no id specified - IResource#setId(IdDt)");
        }
      }

      if (oldId != null && !oldId.isEmpty()) {
        if (!oldId.equals(newRes.getId())) {
View Full Code Here

    }

    for (IResource next : resourceList) {
      if (next.getId() == null || next.getId().isEmpty()) {
        if (!(next instanceof OperationOutcome)) {
          throw new InternalErrorException("Server method returned resource of type[" + next.getClass().getSimpleName() + "] with no ID specified (IResource#setId(IdDt) must be called)");
        }
      }
    }

    if (theServer.getAddProfileTag() != AddProfileTagEnum.NEVER) {
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.