-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add the ability to pass additional debug context #346
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
Conversation
| { | ||
| ...PAK_ACCOUNT, | ||
| someUndefinedField: undefined, | ||
| } as any, |
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.
This was breaking the build for me
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.
Strange. I just tested with as any and it still built
|
|
||
| 1. Checks to see if a config was specified via environment variables (see below) | ||
| 2. If no environment variables are present, looks for a global config file (located at `~/.hscli/config.yml`) | ||
| 3. If no global config file is found, looks up the file tree for a local config file. | ||
| 4. If no local config file is found, throws an error | ||
|
|
||
|
|
||
| ##### Custom config location environment variables | ||
|
|
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.
Prettier write added these, so I just went with it
| export function isHubSpotHttpError(error?: unknown): error is HubSpotHttpError { | ||
| return !!error && error instanceof HubSpotHttpError; | ||
| return ( | ||
| !!error && error instanceof Error && error.name === HubSpotHttpErrorName |
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.
instanceof is not reliable when this package is linked. Comparing the name is a more accurate check
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.
Why is that?
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.
When packages are linked in some places, but not other places, you get multiple versions of the same error class. I.E. if we have LDL linked in the CLI, but not in PPL they will each have their own version of the HubSpotHttpError class that won't match when we run instanceof
|
|
||
| if (statusBasedMessage) { | ||
| errorMessage.push( | ||
| `${statusBasedMessage}${additionalDebugContext ? ` ${additionalDebugContext}` : ''}` |
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.
If there is additional context, append it to the error message
Description and Context
Adds the ability for additional debugging context to be attached to the error message we generate from the status.
Resolves DPGDXFE-104