Skip to content

Commit

Permalink
Enum case syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
veelenga committed Apr 26, 2017
1 parent 3b11a10 commit 3e9fabb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lua/stack/error_handling.cr
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ module Lua::StackMixin
message = err["message"]?.try &.as(String)
traceback = err["traceback"]?.try &.as(String)
case type
when CALL::ERRRUN then RuntimeError.new message, traceback
when CALL::ERRSYNTAX then SyntaxError.new message, traceback
when CALL::ERRMEM then MemoryError.new message, traceback
when CALL::ERRGCMM then GCError.new message, traceback
when CALL::ERRERR then ErrorHandlerError.new message, traceback
when CALL::ERRFILE then FileError.new message, traceback
when .errrun? then RuntimeError.new message, traceback
when .errsyntax? then SyntaxError.new message, traceback
when .errmem? then MemoryError.new message, traceback
when .errgcmm? then GCError.new message, traceback
when .errerr? then ErrorHandlerError.new message, traceback
when .errfile? then FileError.new message, traceback
else
LuaError.new message, traceback
end
Expand Down

0 comments on commit 3e9fabb

Please sign in to comment.