mirror of https://github.com/japl-lang/japl.git
Fixed exception reporting and small test builder bug
This commit is contained in:
parent
bfb57b1552
commit
b5927df998
|
@ -56,7 +56,7 @@ proc log*(level: LogLevel, msg: string) =
|
|||
setForegroundColor(fgDefault)
|
||||
|
||||
proc fatal*(msg: string) =
|
||||
write stderr, msg
|
||||
echo "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||
log(LogLevel.Fatal, msg)
|
||||
raise newException(CatchableError, msg)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ proc parseModalLine(line: string): tuple[modal: bool, mode: string, detail: stri
|
|||
result.modal = false
|
||||
result.mode = ""
|
||||
result.detail = ""
|
||||
if line[0] == '[':
|
||||
if line.len() > 0 and line[0] == '[':
|
||||
result.modal = true
|
||||
else:
|
||||
return result
|
||||
|
@ -144,6 +144,8 @@ proc buildTests*(testDir: string): seq[Test] =
|
|||
try:
|
||||
result &= buildTestFile(candidate)
|
||||
except:
|
||||
write stderr, getCurrentExceptionMsg()
|
||||
write stderr, getCurrentException().getStacktrace()
|
||||
log(LogLevel.Error, &"Building test file {candidate} failed")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue