mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
detect boot error
This commit is contained in:
parent
6e3d42aad6
commit
31715d7d36
@ -13,12 +13,12 @@ export class Urbit
|
||||
#
|
||||
process.on \exit ~> @pty.write '\04' # send EOF to gracefully checkpoint
|
||||
#
|
||||
note: -> console.log "\nnode:".blue, it
|
||||
warn: -> console.log "\nnode:".red, it
|
||||
note: (...args)-> console.log "\nnode:".blue, ...args
|
||||
warn: (...args)-> console.log "\nnode:".red, ...args
|
||||
wait-silent: ~> # this feels hacky
|
||||
new Promise (resolve)~>
|
||||
a = set-interval ~>
|
||||
if Date.now! > @last-output + 1000
|
||||
if Date.now! > @last-output + 2000
|
||||
clear-interval a
|
||||
resolve @last-output
|
||||
, 200
|
||||
|
@ -4,10 +4,15 @@ urbit = new Urbit <[-B urbit.pill -A .. -cFI zod zod]>
|
||||
Promise.resolve urbit
|
||||
.then (urb)->
|
||||
urb.note "Booting urbit"
|
||||
# TODO exit on ford stack trace
|
||||
<- urb.expect /dojo> / .then
|
||||
<- urb.expect-echo "%dojo-booted" .then
|
||||
urb
|
||||
Promise.race [
|
||||
urb.expect-error!then ->
|
||||
urb.warn "Error detected"
|
||||
throw Error "Stack trace while booting"
|
||||
, do
|
||||
<- urb.expect /dojo> / .then
|
||||
<- urb.expect-echo "%dojo-booted" .then
|
||||
urb
|
||||
]
|
||||
.then (urb)->
|
||||
urb.note "Testing compilation"
|
||||
# TODO tally ford stack traces
|
||||
@ -28,5 +33,5 @@ Promise.resolve urbit
|
||||
urbit.exit 0
|
||||
.catch (err)->
|
||||
<- urbit.wait-silent!then # assumptions?
|
||||
urbit.warn err
|
||||
urbit.warn "Test aborted:" err
|
||||
urbit.exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user