This repository has been archived on 2022-07-05. You can view files and clone it, but cannot push or open issues/pull-requests.
steleks_backend/common/src/main/java/ba/steleks/error/exception/CustomHttpStatusException.java

40 lines
1.3 KiB
Java

package ba.steleks.error.exception;/**
* Created by ensar on 30/05/17.
*/
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import java.nio.charset.Charset;
public class CustomHttpStatusException extends HttpStatusCodeException {
private String message;
public CustomHttpStatusException(HttpStatus statusCode, String message) {
super(statusCode);
this.message = message;
}
public CustomHttpStatusException(HttpStatus statusCode, String statusText, String message) {
super(statusCode, statusText);
this.message = message;
}
public CustomHttpStatusException(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset, String message) {
super(statusCode, statusText, responseBody, responseCharset);
this.message = message;
}
public CustomHttpStatusException(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset, String message) {
super(statusCode, statusText, responseHeaders, responseBody, responseCharset);
this.message = message;
}
@Override
public String getMessage() {
return message;
}
}