This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1165 from Nike-Inc/feat/clarify-expected-path-err…
…or-CERB-2058 Return 404 instead of 500 for mismatched paths
- Loading branch information
Showing
5 changed files
with
125 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cerberus-web/src/main/java/com/nike/cerberus/error/InvalidEncryptionContextApiError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.nike.cerberus.error; | ||
|
||
import com.nike.backstopper.apierror.ApiError; | ||
import java.util.Map; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class InvalidEncryptionContextApiError implements ApiError { | ||
|
||
private final String message; | ||
|
||
public InvalidEncryptionContextApiError(String message) { | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "InvalidEncryptionContextException"; | ||
} | ||
|
||
@Override | ||
public String getErrorCode() { | ||
return DefaultApiError.ENTITY_NOT_FOUND.getErrorCode(); | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return this.message; | ||
} | ||
|
||
@Override | ||
public Map<String, Object> getMetadata() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int getHttpStatusCode() { | ||
return HttpServletResponse.SC_NOT_FOUND; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters