-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more properties to errors and export errors. (#112)
- Loading branch information
Showing
18 changed files
with
396 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@google/generative-ai": minor | ||
--- | ||
|
||
Export error classes and add more properties to fetch errors. |
20 changes: 20 additions & 0 deletions
20
docs/reference/main/generative-ai.googlegenerativeaierror._constructor_.md
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,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) > [(constructor)](./generative-ai.googlegenerativeaierror._constructor_.md) | ||
|
||
## GoogleGenerativeAIError.(constructor) | ||
|
||
Constructs a new instance of the `GoogleGenerativeAIError` class | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(message: string); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| message | string | | | ||
|
21 changes: 21 additions & 0 deletions
21
docs/reference/main/generative-ai.googlegenerativeaierror.md
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,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) | ||
|
||
## GoogleGenerativeAIError class | ||
|
||
Basic error type for this SDK. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class GoogleGenerativeAIError extends Error | ||
``` | ||
**Extends:** Error | ||
## Constructors | ||
| Constructor | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [(constructor)(message)](./generative-ai.googlegenerativeaierror._constructor_.md) | | Constructs a new instance of the <code>GoogleGenerativeAIError</code> class | | ||
23 changes: 23 additions & 0 deletions
23
docs/reference/main/generative-ai.googlegenerativeaifetcherror._constructor_.md
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,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) > [(constructor)](./generative-ai.googlegenerativeaifetcherror._constructor_.md) | ||
|
||
## GoogleGenerativeAIFetchError.(constructor) | ||
|
||
Constructs a new instance of the `GoogleGenerativeAIFetchError` class | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(message: string, status?: number, statusText?: string, errorDetails?: ErrorDetails[]); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| message | string | | | ||
| status | number | _(Optional)_ | | ||
| statusText | string | _(Optional)_ | | ||
| errorDetails | ErrorDetails\[\] | _(Optional)_ | | ||
|
11 changes: 11 additions & 0 deletions
11
docs/reference/main/generative-ai.googlegenerativeaifetcherror.errordetails.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) > [errorDetails](./generative-ai.googlegenerativeaifetcherror.errordetails.md) | ||
|
||
## GoogleGenerativeAIFetchError.errorDetails property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
errorDetails?: ErrorDetails[]; | ||
``` |
29 changes: 29 additions & 0 deletions
29
docs/reference/main/generative-ai.googlegenerativeaifetcherror.md
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,29 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) | ||
|
||
## GoogleGenerativeAIFetchError class | ||
|
||
Error class covering HTTP errors when calling the server. Includes HTTP status, statusText, and optional details, if provided in the server response. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class GoogleGenerativeAIFetchError extends GoogleGenerativeAIError | ||
``` | ||
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) | ||
## Constructors | ||
| Constructor | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [(constructor)(message, status, statusText, errorDetails)](./generative-ai.googlegenerativeaifetcherror._constructor_.md) | | Constructs a new instance of the <code>GoogleGenerativeAIFetchError</code> class | | ||
## Properties | ||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [errorDetails?](./generative-ai.googlegenerativeaifetcherror.errordetails.md) | | ErrorDetails\[\] | _(Optional)_ | | ||
| [status?](./generative-ai.googlegenerativeaifetcherror.status.md) | | number | _(Optional)_ | | ||
| [statusText?](./generative-ai.googlegenerativeaifetcherror.statustext.md) | | string | _(Optional)_ | | ||
11 changes: 11 additions & 0 deletions
11
docs/reference/main/generative-ai.googlegenerativeaifetcherror.status.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) > [status](./generative-ai.googlegenerativeaifetcherror.status.md) | ||
|
||
## GoogleGenerativeAIFetchError.status property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
status?: number; | ||
``` |
11 changes: 11 additions & 0 deletions
11
docs/reference/main/generative-ai.googlegenerativeaifetcherror.statustext.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) > [statusText](./generative-ai.googlegenerativeaifetcherror.statustext.md) | ||
|
||
## GoogleGenerativeAIFetchError.statusText property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
statusText?: string; | ||
``` |
21 changes: 21 additions & 0 deletions
21
docs/reference/main/generative-ai.googlegenerativeairesponseerror._constructor_.md
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,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) > [(constructor)](./generative-ai.googlegenerativeairesponseerror._constructor_.md) | ||
|
||
## GoogleGenerativeAIResponseError.(constructor) | ||
|
||
Constructs a new instance of the `GoogleGenerativeAIResponseError` class | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(message: string, response?: T); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| message | string | | | ||
| response | T | _(Optional)_ | | ||
|
27 changes: 27 additions & 0 deletions
27
docs/reference/main/generative-ai.googlegenerativeairesponseerror.md
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,27 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) | ||
|
||
## GoogleGenerativeAIResponseError class | ||
|
||
Errors in the contents of a response from the model. This includes parsing errors, or responses including a safety block reason. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class GoogleGenerativeAIResponseError<T> extends GoogleGenerativeAIError | ||
``` | ||
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) | ||
## Constructors | ||
| Constructor | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [(constructor)(message, response)](./generative-ai.googlegenerativeairesponseerror._constructor_.md) | | Constructs a new instance of the <code>GoogleGenerativeAIResponseError</code> class | | ||
## Properties | ||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [response?](./generative-ai.googlegenerativeairesponseerror.response.md) | | T | _(Optional)_ | | ||
11 changes: 11 additions & 0 deletions
11
docs/reference/main/generative-ai.googlegenerativeairesponseerror.response.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@google/generative-ai](./generative-ai.md) > [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) > [response](./generative-ai.googlegenerativeairesponseerror.response.md) | ||
|
||
## GoogleGenerativeAIResponseError.response property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
response?: T; | ||
``` |
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
Oops, something went wrong.