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

Integrating an detailed error APIs #1411

Open
ChristopherC-STLA opened this issue Dec 11, 2024 · 1 comment
Open

Integrating an detailed error APIs #1411

ChristopherC-STLA opened this issue Dec 11, 2024 · 1 comment

Comments

@ChristopherC-STLA
Copy link

Problem

Today the only way to handle errors like broken references is to parse stderr from console output.

There is the throw option in log.errors.brokenReferences but it just throw on first error and do not provide any detail

    log: {
      errors: {
        brokenReferences: "throw"
      },
    },

Expectation

I would expect an error report API to collect all errors after running a build.
This way a developer act on specific errors or create custom reports.

@jorenbroekema
Copy link
Collaborator

Given that Style Dictionary is not just a tool for exporting tokens and is also used in Design Token management tools such as Tokens Studio platform, Penpot, etc., it makes sense that such tools will want to wrap Style Dictionary runs in try-catch and do their own error handling. For example, a broken reference might be reported in a way where the tool can help the user fixing the broken reference in their design tokens set. E.g. it should report the filePath of the broken ref and the tool might turn that into an anchor so the user can click it and navigate to that tokenset within the design token management tool, to fix it.

Plenty of use cases I think that warrant throwing errors with data objects that can be more easily processed that console error string parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants