2020-08-13 23:39:26 +02:00
|
|
|
import objecttype
|
2020-08-23 12:10:08 +02:00
|
|
|
import stringtype
|
2020-08-10 18:39:53 +02:00
|
|
|
|
|
|
|
|
2020-08-23 12:10:08 +02:00
|
|
|
type JAPLException* = ref object of Obj
|
|
|
|
errName*: String
|
|
|
|
message*: String
|
2020-08-10 18:39:53 +02:00
|
|
|
|
2020-08-13 23:39:26 +02:00
|
|
|
|
|
|
|
func newTypeError*(message: string): JAPLException =
|
2020-08-23 12:10:08 +02:00
|
|
|
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: newString("TypeError"), message: newString(message))
|
2020-08-14 10:02:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
func newIndexError*(message: string): JAPLException =
|
2020-08-23 12:10:08 +02:00
|
|
|
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: newString("IndexError"), message: newString(message))
|
2020-08-14 10:02:13 +02:00
|
|
|
|
2020-08-15 11:27:04 +02:00
|
|
|
|
|
|
|
func newReferenceError*(message: string): JAPLException =
|
2020-08-23 12:10:08 +02:00
|
|
|
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: newString("ReferenceError"), message: newString(message))
|
2020-08-15 11:27:04 +02:00
|
|
|
|
2020-08-19 18:15:48 +02:00
|
|
|
|
|
|
|
func newInterruptedError*(message: string): JAPLException =
|
2020-08-23 12:10:08 +02:00
|
|
|
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: newString("InterruptedError"), message: newString(message))
|
|
|
|
|
2020-08-19 18:15:48 +02:00
|
|
|
|