Skip to content

Conversation

@joe-yeager
Copy link
Contributor

@joe-yeager joe-yeager commented Dec 2, 2025

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

@joe-yeager joe-yeager marked this pull request as draft December 2, 2025 20:42
@joe-yeager joe-yeager changed the title Add the ability to pass additonal debug context feat: Add the ability to pass additional debug context Dec 2, 2025
{
...PAK_ACCOUNT,
someUndefinedField: undefined,
} as any,
Copy link
Contributor Author

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

Copy link
Contributor

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

Comment on lines +16 to +23

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

Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that?

Copy link
Contributor Author

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}` : ''}`
Copy link
Contributor Author

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

@joe-yeager joe-yeager marked this pull request as ready for review December 3, 2025 19:33
@joe-yeager joe-yeager merged commit e927dfd into main Dec 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants