Skip to content

Developing with better error diagnostics

Mark S. Miller edited this page Apr 29, 2021 · 4 revisions

If you are using the bash shell and are debugging multivat code (as all dapp developers do), put exactly the following magic incantation:

export LOCKDOWN_OPTIONS='{"errorTaming":"unsafe","stackFiltering":"verbose"}'

somewhere such that it affects all shells you use to spawn the code under test. Note that this setting is unsafe for production, so put this setting somewhere it is unlikely to affect the shells from which code is spawned for production.

Even knowing the dangers, I added that to my ~/.bashrc file. Once you've done that, either paste it manually into your existing shells or shut those shells down and restart them such that they execute this magic line. For non-bash shells, there will be some similar procedure for setting up environment variables. The string between the single quotes is a JSON encoding of the options to lockdown. Read that document to understand what settings are right for you.

If you use agoric --start -v instead of agoric --start you'll get more diagnostic information scrolling by in the shell you started that in. The -v is the "verbose" flag. Most of this will not be interesting, which is why it's not on by default. But when you see a received error elsewhere, somewhere in all that noise you'll find the corresponding sent error.

See also https://github.com/Agoric/agoric-sdk/blob/master/packages/install-ses/install-ses.js#L8-L40

Clone this wiki locally