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

Return proper errors in LoadFile and LoadString #67

Merged
merged 2 commits into from
Mar 16, 2017

Conversation

AlexMax
Copy link
Contributor

@AlexMax AlexMax commented Jan 26, 2017

  • Error messages did not properly chunkID the source filename, leading to @'s next to filenames and such.
  • LoadFile improperly raised a generic file read error, even if the actual error was a Lua error such as a SyntaxError.

- Error messages did not properly chunkID the source filename, leading
to @'s next to filenames and such.
- LoadFile improperly raised a generic file read error, even if the
actual error was a Lua error such as a SyntaxError.
auxiliary.go Outdated
switch err {
case nil: // do nothing
case SyntaxError: // do nothing
case MemoryError: // do nothing
Copy link
Member

Choose a reason for hiding this comment

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

You could merge these cases as:

switch err {
case nil, SyntaxError, MemoryError: // do nothing
default:
  ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Updated.

@AlexMax AlexMax mentioned this pull request Feb 10, 2017
@fbogsany fbogsany merged commit 458ed14 into Shopify:master Mar 16, 2017
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