All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.client.ErrorResponseException Maven / Gradle / Ivy

The newest version!
package io.sphere.sdk.client;

import io.sphere.sdk.models.errors.ErrorResponse;
import io.sphere.sdk.models.errors.SphereError;

import java.util.Collections;
import java.util.List;

/**
 Typical exception for bad requests containing error information.

 

A list of error codes can be found on the commercetools website.

*/ public class ErrorResponseException extends BadRequestException implements ErrorResponse { private static final long serialVersionUID = 0L; private final Integer statusCode; private final List errors; public ErrorResponseException(final ErrorResponse errorResponse) { this(errorResponse.getStatusCode(), errorResponse.getMessage(), errorResponse.getErrors()); } ErrorResponseException(final Integer statusCode, final String message, final List errors) { super(message); this.statusCode = statusCode; this.errors = errors == null ? Collections.emptyList() : errors; } @Override public Integer getStatusCode() { return statusCode; } @Override public List getErrors() { return errors; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy