json_translater: catch better
This commit is contained in:
parent
818c23f025
commit
c65fcc27ed
|
@ -18,9 +18,8 @@ proc runChild: string =
|
|||
cmd = params[0]
|
||||
args = params[1..params.high]
|
||||
try: result = execProcess(command=cmd, args=args, options={poUsePath})
|
||||
except:
|
||||
stderr.writeLine "execProcess failed"
|
||||
quit 1
|
||||
except CatchableError as err:
|
||||
quit("execProcess failed: " &err.msg)
|
||||
if result == "":
|
||||
stderr.writeLine "no ouput"
|
||||
quit 1
|
||||
|
@ -28,9 +27,8 @@ proc runChild: string =
|
|||
proc translate(output: string): Assertion =
|
||||
var js: JsonNode
|
||||
try: js = parseJson output
|
||||
except CatchableError:
|
||||
stderr.writeLine "parseJson failed"
|
||||
quit 1
|
||||
except CatchableError as err:
|
||||
quit("parseJson failed: " &err.msg)
|
||||
js.toPreserveHook(Ref)
|
||||
|
||||
runActor("main") do (root: Ref; turn: var Turn):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20230701"
|
||||
version = "20230726"
|
||||
author = "Emery Hemingway"
|
||||
description = "Utilites for Syndicated Actors and Synit"
|
||||
license = "unlicense"
|
||||
|
|
Loading…
Reference in New Issue