diff --git a/api/src/main/java/dev/fitko/fitconnect/api/exceptions/RestApiException.java b/api/src/main/java/dev/fitko/fitconnect/api/exceptions/RestApiException.java index e788e13a8b0c80522ee3dfed0b4746c2cdc1c177..bbefe15ed5db248b3f7738422ed16c1980af2b46 100644 --- a/api/src/main/java/dev/fitko/fitconnect/api/exceptions/RestApiException.java +++ b/api/src/main/java/dev/fitko/fitconnect/api/exceptions/RestApiException.java @@ -2,7 +2,7 @@ package dev.fitko.fitconnect.api.exceptions; public class RestApiException extends RuntimeException { - private int statusCode = 400; + private int statusCode = 500; public RestApiException(final String errorMessage, final Throwable error) { super(errorMessage, error); diff --git a/core/src/main/java/dev/fitko/fitconnect/core/http/HttpClient.java b/core/src/main/java/dev/fitko/fitconnect/core/http/HttpClient.java index ed13273fd7fd728e36dff819eb4c25959a9b1998..c6a280a40d654f3fec7f496f9378ede7c84c8e08 100644 --- a/core/src/main/java/dev/fitko/fitconnect/core/http/HttpClient.java +++ b/core/src/main/java/dev/fitko/fitconnect/core/http/HttpClient.java @@ -64,7 +64,7 @@ public class HttpClient { try (Response response = this.httpClient.newCall(request).execute()) { return this.evaluateStatusAndRespond(response, responseType); } catch (IOException exception) { - throw new RestApiException("HTTP GET call to '" + url + "' failed.", exception, 500); + throw new RestApiException("HTTP GET call to '" + url + "' failed.", exception); } } @@ -88,7 +88,7 @@ public class HttpClient { } } catch (IOException exception) { - throw new RestApiException("HTTP POST call to '" + url + "' failed.", exception, 500); + throw new RestApiException("HTTP POST call to '" + url + "' failed.", exception); } } @@ -112,7 +112,7 @@ public class HttpClient { } } catch (IOException exception) { - throw new RestApiException("HTTP PUT call to '" + url + "' failed.", exception, 500); + throw new RestApiException("HTTP PUT call to '" + url + "' failed.", exception); } }