loader: `MModule::load` cause build_module_importation
[nit.git] / lib / json / error.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # This file is free software, which comes along with NIT. This software is
4 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6 # PARTICULAR PURPOSE. You can modify it is you want, provided this header
7 # is kept unaltered, and a notification of the changes is added.
8 # You are allowed to redistribute it and sell it, alone or is a part of
9 # another product.
10
11 # Errors related to JSON parsing.
12 module json::error
13
14 import nitcc_runtime
15
16 # Ill-formed JSON.
17 class JsonParseError
18 super Error
19
20 # The location of the error in the original text.
21 var position: nullable Position
22
23 redef fun to_s do
24 var p = position
25 if p isa Position then
26 return "Error Parsing JSON: [{p}] {super}"
27 else
28 return super
29 end
30 end
31 end