Examples of APIError


Examples of com.detectlanguage.errors.APIError

        if (body.contains("\"error\":")) {
            ErrorResponse errorResponse = gson.fromJson(body,
                    ErrorResponse.class);
            ErrorData error = errorResponse.error;
            throw new APIError(error.message, error.code);
        }

        return gson.fromJson(body, responseClass);
    }
View Full Code Here

Examples of com.wordnik.swagger.annotations.ApiError

     * @param doc XML Document to add
     * @param methodElement Method declaration to look at
     * @param parent The parent xml element to attach the result to
     */
    private void processErrors(Document doc, ExecutableElement methodElement, Element parent) {
        ApiError ae = methodElement.getAnnotation(ApiError.class);
        processError(doc,ae,parent);
        ApiErrors aes = methodElement.getAnnotation(ApiErrors.class);
        if (aes != null) {
            for (ApiError ae2 : aes.value()) {
                processError(doc,ae2,parent);
View Full Code Here

Examples of detect.api.models.ApiError

    }
    return result;
  }

  public ApiError getApiError() {
    ApiError ae = new ApiError();
      String[] tagList = {"code", "description"};
      ArrayList<String> error = getValues("error", tagList);
      ae.setErrorCode(error.get(0));
      ae.setErrorDescription(error.get(1));
      return ae;
  }
View Full Code Here

Examples of org.entando.entando.aps.system.services.api.model.ApiError

            if (null != fieldErrors) {
                for (int i = 0; i < fieldErrors.size(); i++) {
                    FieldError fieldError = fieldErrors.get(i);
                    if (fieldError instanceof AttributeFieldError) {
                        AttributeFieldError attributeError = (AttributeFieldError) fieldError;
                        errors.add(new ApiError(IApiErrorCodes.API_VALIDATION_ERROR,
                attributeError.getFullMessage(), Response.Status.CONFLICT));
                    } else {
                        errors.add(new ApiError(IApiErrorCodes.API_VALIDATION_ERROR,
                fieldError.getMessage(), Response.Status.CONFLICT));
                    }
                }
            }
        } catch (Throwable t) {
View Full Code Here

Examples of org.graylog2.plugin.rest.ApiError

* @author Dennis Oelkers <dennis@torch.sh>
*/
public class NotFoundExceptionMapper implements ExceptionMapper<NotFoundException> {
    @Override
    public Response toResponse(NotFoundException exception) {
        ApiError apiError = new ApiError(exception.getMessage());
        return Response.status(Response.Status.NOT_FOUND).entity(apiError).build();
    }
View Full Code Here

Examples of org.graylog2.plugin.rest.ApiError

* @author Dennis Oelkers <dennis@torch.sh>
*/
public class ValidationExceptionMapper implements ExceptionMapper<ValidationException> {
    @Override
    public Response toResponse(ValidationException exception) {
        ApiError error = new ValidationApiError("Validation failed!", exception.getErrors());
        return Response.status(Response.Status.BAD_REQUEST).entity(error).build();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.