hadronous / pic-js

An Internet Computer Protocol canister testing library for TypeScript and JavaScript.
https://hadronous.github.io/pic-js/
Apache License 2.0
11 stars 6 forks source link

Error messages from trap in timers not showing #68

Open infu opened 3 weeks ago

infu commented 3 weeks ago

Starting server with PocketIcServer.start({showRuntimeLogs:false, showCanisterLogs:true }) Debug.print(...) shows in console Canister trapping (ex: Debug.trap(...)), division by zero,.. doesn't show in timers/heartbeat Not entirely sure if the problem is in pic-js, pocketic or Motoko

nathanosdev commented 2 weeks ago

It's possible to show these logs, but requires an update to pic-js. If you're interested in contributing, this PR on the Rust library implements what's needed: https://github.com/dfinity/ic/pull/2533. Otherwise, I should be able to get to this myself in the coming weeks.

mraszyk commented 2 weeks ago

The Rust library PR effectively makes a query call to the management canister's endpoint fetch_canister_logs, see spec.