japl/nim/types/exceptions.nim

14 lines
485 B
Nim
Raw Normal View History

import objecttype
2020-08-10 18:39:53 +02:00
type JAPLException* = ref object of Obj
2020-08-10 18:39:53 +02:00
func newTypeError*(message: string): JAPLException =
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: Obj(kind: STRING, str: "TypeError"), message: Obj(kind: ObjectTypes.STRING, str: message))
func newIndexError*(message: string): JAPLException =
result = JAPLException(kind: ObjectTypes.EXCEPTION, errName: Obj(kind: STRING, str: "IndexError"), message: Obj(kind: ObjectTypes.STRING, str: message))