|
@@ -6,19 +6,17 @@ import lombok.ToString; |
|
|
import org.cobbzilla.util.http.HttpRequestBean; |
|
|
import org.cobbzilla.util.http.HttpRequestBean; |
|
|
import org.cobbzilla.wizard.util.RestResponse; |
|
|
import org.cobbzilla.wizard.util.RestResponse; |
|
|
|
|
|
|
|
|
import static org.cobbzilla.util.json.JsonUtil.json; |
|
|
|
|
|
|
|
|
|
|
|
@AllArgsConstructor @ToString |
|
|
@AllArgsConstructor @ToString |
|
|
public class ApiException extends RuntimeException { |
|
|
public class ApiException extends RuntimeException { |
|
|
|
|
|
|
|
|
@Getter private HttpRequestBean request; |
|
|
@Getter private HttpRequestBean request; |
|
|
@Getter private RestResponse response; |
|
|
|
|
|
|
|
|
@Getter private final RestResponse response; |
|
|
|
|
|
|
|
|
public ApiException (RestResponse response) { |
|
|
public ApiException (RestResponse response) { |
|
|
super(response.status+": "+response.json); |
|
|
super(response.status+": "+response.json); |
|
|
this.response = response; |
|
|
this.response = response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override public String getMessage () { return response.json; } |
|
|
|
|
|
|
|
|
@Override public String getMessage () { return response.status + ": " + response.json; } |
|
|
|
|
|
|
|
|
} |
|
|
} |