From a7b18738aa7f723e3ea7a8bd0bbdbe418d25734b Mon Sep 17 00:00:00 2001 From: Rebecca Dong Date: Wed, 7 Oct 2020 17:01:21 -0700 Subject: [PATCH] Fix: lower dpm from errors --- .../src/main/java/com/nike/cerberus/util/CustomApiError.java | 3 +-- .../controller/authentication/AwsIamStsAuthController.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cerberus-core/src/main/java/com/nike/cerberus/util/CustomApiError.java b/cerberus-core/src/main/java/com/nike/cerberus/util/CustomApiError.java index a96df6b1a..a5c29d863 100644 --- a/cerberus-core/src/main/java/com/nike/cerberus/util/CustomApiError.java +++ b/cerberus-core/src/main/java/com/nike/cerberus/util/CustomApiError.java @@ -19,13 +19,12 @@ import com.nike.backstopper.apierror.ApiError; import com.nike.backstopper.apierror.ApiErrorBase; import com.nike.cerberus.error.DefaultApiError; -import java.util.UUID; public final class CustomApiError { public static ApiError createCustomApiError(DefaultApiError error, final String message) { return new ApiErrorBase( - "custom-error-wrapper-" + UUID.randomUUID().toString(), + error.getName(), error.getErrorCode(), error.getMessage() + " " + message, error.getHttpStatusCode()); diff --git a/cerberus-web/src/main/java/com/nike/cerberus/controller/authentication/AwsIamStsAuthController.java b/cerberus-web/src/main/java/com/nike/cerberus/controller/authentication/AwsIamStsAuthController.java index 8ba2f74cc..441da0afa 100644 --- a/cerberus-web/src/main/java/com/nike/cerberus/controller/authentication/AwsIamStsAuthController.java +++ b/cerberus-web/src/main/java/com/nike/cerberus/controller/authentication/AwsIamStsAuthController.java @@ -80,7 +80,7 @@ public AuthTokenResponse authenticate( authResponse = authenticationService.stsAuthenticate(iamPrincipalArn); } catch (Exception e) { auditLoggingFilterDetails.setAction("Failed to authenticate with AWS IAM STS Auth"); - throw e; // TODO, throw a Backstopper error here + throw e; } auditLoggingFilterDetails.setAction("Successfully authenticated with AWS IAM STS Auth");