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

Propage errors from the init() mether #2378

Closed
MindaugasLaganeckas opened this issue Oct 4, 2021 · 0 comments · Fixed by #2379
Closed

Propage errors from the init() mether #2378

MindaugasLaganeckas opened this issue Oct 4, 2021 · 0 comments · Fixed by #2379
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@MindaugasLaganeckas
Copy link
Member

Is your feature request related to a problem? Please describe.
I have been looking into several issues related to propagating the syntax errors from mermaid to other clients, e.g. mermaid-cli. By inspecting the code of mermaid.js (

} catch (e) {
), I can see that all errors are caught on the mermaid level and never propagated to the clients. That is a problem described in several issues. One is here (mermaid-js/mermaid-cli#138)

Describe the solution you'd like
Make another function called init(), rename existing one to initThrowsErrors(). The new init() calls initThrowsErrors() and try-catch lives in init(). Then clients can choose either to call init() or initThrowsErrors()

Describe alternatives you've considered
Remove try-catch in the current implementation of init()
Reimplement parts of the init() in mermaid-cli

Additional context
Discussion in slack: https://mermaid-talk.slack.com/archives/CL256P19N/p1633101057039000

@MindaugasLaganeckas MindaugasLaganeckas added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant