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

Use error for invalid DisplayKind in show #28

Merged
merged 3 commits into from
Oct 11, 2021
Merged

Use error for invalid DisplayKind in show #28

merged 3 commits into from
Oct 11, 2021

Conversation

ire4ever1190
Copy link
Contributor

using dkHtml in show gave this

Unsupported kind for show dkHtml
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

which while says the issue, also gives a nil access error that I found to be confusing. This PR uses the {.error.} pragma instead
so that a compile time error is thrown instead

@@ -105,7 +106,7 @@ template show*(kind:DisplayKind, what:untyped) =
elif kind == dkPlot:
content = showBase64StringPng(what, size[0], size[1])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stisa I also noticed this line which will throw error if size is not defined in scope. Should this be removed or left in?

Copy link
Owner

Choose a reason for hiding this comment

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

yep looks like I forgot to remove that branch, it should be caught by the other show template, thanks for noticing

@stisa stisa merged commit 8f5925c into stisa:master Oct 11, 2021
@ire4ever1190 ire4ever1190 deleted the display-error-msg branch October 11, 2021 22:32
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