Skip to content
Snippets Groups Projects
Commit c74c7d8e authored by Henry Borasch's avatar Henry Borasch
Browse files

978: set default HTTP error code to 500

parent 2881c695
No related branches found
No related tags found
1 merge request!169978: remove spring-web
This commit is part of merge request !169. Comments created here will be created in the context of that merge request.
...@@ -2,7 +2,7 @@ package dev.fitko.fitconnect.api.exceptions; ...@@ -2,7 +2,7 @@ package dev.fitko.fitconnect.api.exceptions;
public class RestApiException extends RuntimeException { public class RestApiException extends RuntimeException {
private int statusCode = 400; private int statusCode = 500;
public RestApiException(final String errorMessage, final Throwable error) { public RestApiException(final String errorMessage, final Throwable error) {
super(errorMessage, error); super(errorMessage, error);
......
...@@ -64,7 +64,7 @@ public class HttpClient { ...@@ -64,7 +64,7 @@ public class HttpClient {
try (Response response = this.httpClient.newCall(request).execute()) { try (Response response = this.httpClient.newCall(request).execute()) {
return this.evaluateStatusAndRespond(response, responseType); return this.evaluateStatusAndRespond(response, responseType);
} catch (IOException exception) { } 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 { ...@@ -88,7 +88,7 @@ public class HttpClient {
} }
} catch (IOException exception) { } 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 { ...@@ -112,7 +112,7 @@ public class HttpClient {
} }
} catch (IOException exception) { } catch (IOException exception) {
throw new RestApiException("HTTP PUT call to '" + url + "' failed.", exception, 500); throw new RestApiException("HTTP PUT call to '" + url + "' failed.", exception);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment