Skip to content
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

Tp 2495 add logging to sol extension #263

Closed
wants to merge 6 commits into from

Conversation

sharlotta93
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hosted-pages ❌ Failed (Inspect) Sep 17, 2024 11:16am

console.error('Zod parsing error', result.error.issues)
log(
{
message: `${basicMessage}: zod parsing error`,
Copy link
Contributor

@nckhell nckhell Sep 15, 2024

Choose a reason for hiding this comment

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

This error deserves some special attention because it means either Awell or SOL violated the API contract. I.e. the payload we received doesn't match the payload we agreed upon.

So I'd maybe not label it as a Zod error but call it something else and give it a more explicit name (maybe it's own error class?)

Example:

class SolApiResponseError extends Error {
  public issues

  constructor(message: string, issues: any[]) {
    super(message);
    this.name = 'SolApiResponseError';
    this.issues = issues;
  }
}

(same comment for the other fetch functions)

@sharlotta93 sharlotta93 deleted the TP-2495-add-logging-to-sol-extension branch September 18, 2024 11:12
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.

2 participants