-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: (first draft) Introduce error/exception types and abstract …
…HttpRequest attempts
- Loading branch information
1 parent
12af785
commit b6853fb
Showing
10 changed files
with
388 additions
and
230 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfga/sdk/errors/FgaApiAuthenticationError.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,14 @@ | ||
package dev.openfga.sdk.errors; | ||
|
||
import java.net.http.HttpHeaders; | ||
|
||
public class FgaApiAuthenticationError extends ApiException { | ||
public FgaApiAuthenticationError( | ||
String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { | ||
super(message, code, responseHeaders, responseBody); | ||
} | ||
|
||
public FgaApiAuthenticationError(String message, int code, HttpHeaders responseHeaders, String responseBody) { | ||
this(message, (Throwable) null, code, responseHeaders, responseBody); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfga/sdk/errors/FgaApiInternalError.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,14 @@ | ||
package dev.openfga.sdk.errors; | ||
|
||
import java.net.http.HttpHeaders; | ||
|
||
public class FgaApiInternalError extends ApiException { | ||
public FgaApiInternalError( | ||
String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { | ||
super(message, code, responseHeaders, responseBody); | ||
} | ||
|
||
public FgaApiInternalError(String message, int code, HttpHeaders responseHeaders, String responseBody) { | ||
this(message, (Throwable) null, code, responseHeaders, responseBody); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfga/sdk/errors/FgaApiNotFoundError.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,14 @@ | ||
package dev.openfga.sdk.errors; | ||
|
||
import java.net.http.HttpHeaders; | ||
|
||
public class FgaApiNotFoundError extends ApiException { | ||
public FgaApiNotFoundError( | ||
String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { | ||
super(message, code, responseHeaders, responseBody); | ||
} | ||
|
||
public FgaApiNotFoundError(String message, int code, HttpHeaders responseHeaders, String responseBody) { | ||
this(message, (Throwable) null, code, responseHeaders, responseBody); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfga/sdk/errors/FgaApiRateLimitExceededError.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,14 @@ | ||
package dev.openfga.sdk.errors; | ||
|
||
import java.net.http.HttpHeaders; | ||
|
||
public class FgaApiRateLimitExceededError extends ApiException { | ||
public FgaApiRateLimitExceededError( | ||
String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { | ||
super(message, code, responseHeaders, responseBody); | ||
} | ||
|
||
public FgaApiRateLimitExceededError(String message, int code, HttpHeaders responseHeaders, String responseBody) { | ||
this(message, (Throwable) null, code, responseHeaders, responseBody); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfga/sdk/errors/FgaApiValidationError.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,14 @@ | ||
package dev.openfga.sdk.errors; | ||
|
||
import java.net.http.HttpHeaders; | ||
|
||
public class FgaApiValidationError extends ApiException { | ||
public FgaApiValidationError( | ||
String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { | ||
super(message, code, responseHeaders, responseBody); | ||
} | ||
|
||
public FgaApiValidationError(String message, int code, HttpHeaders responseHeaders, String responseBody) { | ||
this(message, (Throwable) null, code, responseHeaders, responseBody); | ||
} | ||
} |
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