Merge pull request #377 from asarhaddon/fix-runtests-pre-eval
[jackhill/mal.git] / crystal / error.cr
CommitLineData
492144ce 1require "./types"
2
9b8a3da9 3module Mal
4 class ParseException < Exception
5 end
6
7 class EvalException < Exception
8 end
1ec34655 9
10 class RuntimeException < Exception
11 getter :thrown
5185c56e 12
492144ce 13 def initialize(@thrown : Type)
1ec34655 14 super()
15 end
16 end
9b8a3da9 17end
18
19def eval_error(msg)
20 raise Mal::EvalException.new msg
21end
22
23def parse_error(msg)
24 raise Mal::ParseException.new msg
25end