Skip to content

Commit

Permalink
Bug - preserve stacktrace (#5)
Browse files Browse the repository at this point in the history
* Preserve stacktrace

* Bump version
  • Loading branch information
rkondratowicz authored and alectronic0 committed May 30, 2018
1 parent d92a7a3 commit 6207e70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'uk.gov.hmcts.reform.auth'
version = '2.1.2'
version = '2.1.3'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package uk.gov.hmcts.reform.auth.checker.core.exceptions;

public class BearerTokenInvalidException extends AuthCheckerException {
public BearerTokenInvalidException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ private Service getTokenDetails(String bearerToken) {
try {
return serviceResolver.getTokenDetails(bearerToken);
} catch (ServiceTokenInvalidException e) {
throw new BearerTokenInvalidException();
throw new BearerTokenInvalidException(e);
} catch (ServiceTokenParsingException e) {
throw new AuthCheckerException("Error parsing JWT token");
throw new AuthCheckerException("Error parsing JWT token", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ private T getTokenDetails(String bearerToken) {
try {
return userResolver.getTokenDetails(bearerToken);
} catch (UserTokenInvalidException e) {
throw new BearerTokenInvalidException();
throw new BearerTokenInvalidException(e);
} catch (UserTokenParsingException e) {
throw new AuthCheckerException("Error parsing JWT token");
throw new AuthCheckerException("Error parsing JWT token", e);
}
}

Expand Down

0 comments on commit 6207e70

Please sign in to comment.