-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more properties to errors and export errors. #112
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to capitalize
http
in our Firebase JS SDK's docs:See here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.