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 error strings with "trivial" closure. #2

Merged
merged 1 commit into from May 12, 2015

Conversation

IonoclastBrigham
Copy link
Contributor

Basically, this just returns an error string as a second return value, if a problem occurred loading the mo file.
This follows the Lua idiom established by e.g. io.open().
The client can now handle error conditions, if they care, rather than living with a mysterious, silent failure.
I also beefed up the first check for a valid path; type(mo_file) ~= "string") will catch nil as well as other types.

I checked that this file compiles and handles path errors reasonably.
I don't know the .mo format well enough to exercise the other error clauses, but they're pretty straightforward.

Basically, this just returns an error string as a second return value, if a problem occurred loading the mo file.
This follows the Lua idiom established by e.g. io.open().
The client can now handle error conditions, if they care, rather than living with a mysterious, silent failure.
I also beefed up the first check for a valid path; `type(mo_file) ~= "string")` will catch nil as well as other types.

I checked that this file compiles and handles path errors reasonably.
I don't know the .mo format well enough to exercise the other error clauses, but they're pretty straightforward.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f6edddc on IonoclastBrigham:patch-1 into 3bc2b5f on starius:master.

starius added a commit that referenced this pull request May 12, 2015
Return error strings with "trivial" closure.
@starius starius merged commit 25f1fa4 into starius:master May 12, 2015
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.

None yet

3 participants