-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding custom ConjureDefined exception types
- Loading branch information
Pritham Marupaka
committed
Oct 21, 2024
1 parent
d83c659
commit a6d4cb7
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
errors/src/main/java/com/palantir/conjure/java/api/errors/ConjureDefinedError.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,16 @@ | ||
package com.palantir.conjure.java.api.errors; | ||
|
||
import com.palantir.logsafe.Arg; | ||
import com.palantir.logsafe.SafeLoggable; | ||
|
||
// TODO(pm): according to java docs on Error an "Error - indicates serious problems that a reasonable application should | ||
// not try to catch." Perhaps this isn't a good name, but we've already called something SerializableError and the | ||
// "error" matches the conjure concept so this seems fine but check if folks care. | ||
// TODO(pm): copy-paste the ServiceException logic. I don't like extending ServiceException because we have | ||
// (instanceof ServiceException) checks scattered across a few repos. Enumerate them, and see if they need to be | ||
// handled differently compared to ServiceException. | ||
public final class ConjureDefinedError extends ServiceException implements SafeLoggable { | ||
public ConjureDefinedError(ErrorType errorType, Arg<?>... parameters) { | ||
super(errorType, parameters); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
errors/src/main/java/com/palantir/conjure/java/api/errors/ConjureDefinedRemoteException.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,9 @@ | ||
package com.palantir.conjure.java.api.errors; | ||
|
||
// TODO(pm): copy-paste RemoteException logic. we have instanceof checks scattered across a few repos that we should be | ||
// intentional about. | ||
public final class ConjureDefinedRemoteException extends RemoteException { | ||
public ConjureDefinedRemoteException(SerializableError error, int status) { | ||
super(error, status); | ||
} | ||
} |
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
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