-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ApiError back for backwards compat
- Loading branch information
1 parent
5c6b681
commit a4f715c
Showing
4 changed files
with
76 additions
and
37 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
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,42 @@ | ||
package com.assemblyai.api.core; | ||
|
||
/** | ||
* This exception type will be thrown for any non-2XX API responses. | ||
*/ | ||
public class ApiError extends AssemblyAIException { | ||
/** | ||
* The error code of the response that triggered the exception. | ||
*/ | ||
private final int statusCode; | ||
|
||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public ApiError(String message, int statusCode, Object body) { | ||
super(message); | ||
this.statusCode = statusCode; | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the statusCode | ||
*/ | ||
public int statusCode() { | ||
return this.statusCode; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
public Object body() { | ||
return this.body; | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return "AssemblyAIApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " | ||
+ body + "}"; | ||
} | ||
} |
39 changes: 2 additions & 37 deletions
39
src/main/java/com/assemblyai/api/core/AssemblyAIApiException.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 |
---|---|---|
@@ -1,45 +1,10 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.assemblyai.api.core; | ||
|
||
/** | ||
* This exception type will be thrown for any non-2XX API responses. | ||
*/ | ||
public class AssemblyAIApiException extends AssemblyAIException { | ||
/** | ||
* The error code of the response that triggered the exception. | ||
*/ | ||
private final int statusCode; | ||
|
||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public class AssemblyAIApiException extends ApiError { | ||
public AssemblyAIApiException(String message, int statusCode, Object body) { | ||
super(message); | ||
this.statusCode = statusCode; | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the statusCode | ||
*/ | ||
public int statusCode() { | ||
return this.statusCode; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
public Object body() { | ||
return this.body; | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return "AssemblyAIApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " | ||
+ body + "}"; | ||
super(message, statusCode, body); | ||
} | ||
} |