-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(restli): log aspect-not-found as a warning rather than as an error (
- Loading branch information
Showing
4 changed files
with
58 additions
and
6 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
47 changes: 47 additions & 0 deletions
47
metadata-utils/src/main/java/com/linkedin/metadata/restli/NonExceptionHttpErrorResponse.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,47 @@ | ||
package com.linkedin.metadata.restli; | ||
|
||
import com.linkedin.restli.common.HttpStatus; | ||
import com.linkedin.restli.server.RestLiServiceException; | ||
import com.linkedin.restli.server.errors.ServiceError; | ||
|
||
/** | ||
* Captures an error <i>response</i> (e.g. 404-not-found) that is not to be regarded as an | ||
* <i>exception</i> within the server. <br> | ||
* <br> | ||
* Restli apparently requires http-error-responses to be represented by {@link | ||
* RestLiServiceException}; thus, we need this class to specify an error <i>response</i> that isn't | ||
* really an <i>exception</i> (in the context of the server). <br> | ||
* To highlight the unusual purpose of this exception, the name of this class is also deliberately | ||
* unconventional (the class-name doesn't end with "Exception"). | ||
*/ | ||
public class NonExceptionHttpErrorResponse extends RestLiServiceException { | ||
|
||
public NonExceptionHttpErrorResponse(HttpStatus status) { | ||
super(status); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse(HttpStatus status, String message) { | ||
super(status, message); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse(HttpStatus status, Throwable cause) { | ||
super(status, cause); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse(HttpStatus status, String message, Throwable cause) { | ||
super(status, message, cause); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse( | ||
HttpStatus status, String message, Throwable cause, boolean writableStackTrace) { | ||
super(status, message, cause, writableStackTrace); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse(ServiceError serviceError) { | ||
super(serviceError); | ||
} | ||
|
||
public NonExceptionHttpErrorResponse(ServiceError serviceError, Throwable cause) { | ||
super(serviceError, cause); | ||
} | ||
} |
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