-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
PINECONE_DEBUG
request middleware (#136)
## Problem Sometimes it is helpful to see exactly what requests are being made under the hood. ## Solution Define new middleware functions that log out helpful information. Set new env vars for extra output: ```sh PINECONE_DEBUG=true PINECONE_DEBUG_CURL=true ``` <img width="1496" alt="Screenshot 2023-10-06 at 5 32 44 PM" src="https://github.com/pinecone-io/pinecone-ts-client/assets/1326365/4054f44e-6eb0-4216-8bad-ff5c8cfeffa3"> ## Type of Change - [x] None of the above: developer-oriented feature ## Test Plan Describe specific steps for validating this change.
- Loading branch information
Showing
2 changed files
with
83 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ResponseError } from '../pinecone-generated-ts-fetch'; | ||
|
||
export const responseError = (status: number, message: string) => { | ||
return new ResponseError( | ||
{ | ||
status, | ||
text: async () => message, | ||
} as Response, | ||
'oops' | ||
); | ||
}; |