clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

REPL crash

Open obycode opened this issue 3 years ago • 0 comments

From Discord:

The REPL will crash when using try! or unwrap-panic! on a contract call returning an error. For example, using this contract:

(define-public (bad (arg uint))
  (if (is-eq arg u100) (ok u0) (err u1))
)

you'll see the following in the repl:

>> (try! (contract-call? .foo bad u1))
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ShortReturn(ExpectedValue(Response(ResponseData { committed: false, data: UInt(1) })))', /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/clarity-repl-0.28.2/src/repl/interpreter.rs:516:89
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

obycode avatar Jun 02 '22 17:06 obycode