Merge pull request #77 from mrjohnson22/master

#76 Set a message for error responses
This commit is contained in:
ma1uta
2020-12-20 11:14:20 +00:00
committed by GitHub
3 changed files with 3 additions and 1 deletions

View File

@@ -23,5 +23,6 @@ package io.kamax.mxisd.exception;
public class InvalidParamException extends RuntimeException { public class InvalidParamException extends RuntimeException {
public InvalidParamException() { public InvalidParamException() {
super("The chosen hash algorithm is invalid or disallowed");
} }
} }

View File

@@ -23,5 +23,6 @@ package io.kamax.mxisd.exception;
public class InvalidPepperException extends RuntimeException { public class InvalidPepperException extends RuntimeException {
public InvalidPepperException() { public InvalidPepperException() {
super("The provided pepper is invalid or expired");
} }
} }

View File

@@ -189,7 +189,7 @@ public abstract class BasicHttpHandler implements HttpHandler {
} }
protected void respond(HttpServerExchange ex, int status, String errCode, String error) { protected void respond(HttpServerExchange ex, int status, String errCode, String error) {
respond(ex, status, buildErrorBody(ex, errCode, error)); respond(ex, status, buildErrorBody(ex, errCode, error != null ? error : "An error has occurred"));
} }
protected void handleException(HttpServerExchange exchange, HttpMatrixException ex) { protected void handleException(HttpServerExchange exchange, HttpMatrixException ex) {