Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not logging errors from API server. #762

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,15 @@ private APIError handleIdPException(IdentityProviderManagementException e,
*/
private APIError handleAuthenticatorException(AuthenticatorMgtException e) {

ErrorResponse errorResponse = new ErrorResponse.Builder()
ErrorResponse.Builder errorResponseBuilder = new ErrorResponse.Builder()
.withCode(e.getErrorCode())
.withMessage(e.getMessage())
.withDescription(e.getDescription()).build();
.withDescription(e.getDescription());
Response.Status status;
ErrorResponse errorResponse;

if (e instanceof AuthenticatorMgtClientException) {
errorResponse = errorResponseBuilder.build(log, e.getMessage());
if (e.getErrorCode() != null) {
String errorCode = e.getErrorCode();
errorCode =
Expand All @@ -1027,6 +1029,7 @@ private APIError handleAuthenticatorException(AuthenticatorMgtException e) {
errorResponse.setDescription(e.getDescription());
status = Response.Status.BAD_REQUEST;
} else if (e instanceof AuthenticatorMgtServerException) {
errorResponse = errorResponseBuilder.build(log, e, e.getMessage());
if (e.getErrorCode() != null) {
String errorCode = e.getErrorCode();
errorCode =
Expand All @@ -1037,6 +1040,7 @@ private APIError handleAuthenticatorException(AuthenticatorMgtException e) {
errorResponse.setDescription(e.getDescription());
status = Response.Status.INTERNAL_SERVER_ERROR;
} else {
errorResponse = errorResponseBuilder.build(log, e, e.getMessage());
status = Response.Status.INTERNAL_SERVER_ERROR;
}
return new APIError(status, errorResponse);
Expand Down
Loading