In that case, maybe the message should be rephrased as it is a bit misleading if it’s not a canister?
Or perhaps this new message should just be removed? I’m not sure what additional value this message provides for developers, at least from my perspective.
Canisters call system API calls too, not only other canisters. The error message is indeed trying to tell you that your canister called the ic0.trap system API (I think it’s super clear, there’s no other set of APIs namespaced by ic0 and no canisters like that afaik), which means that your canister trapped explicitly by calling the respective system API.
There’s some work to improve the error messages in general which would also add some doc links. Probably with that it would be even clearer because I’d imagine we’d link to the interface spec where the ic0.trap call is defined.
Thanks for the feedback. Even if it were clear and included a link, I think such a message, which was not there in the past, actually adds noise.
As a developer building my own project on the IC, I was looking to make an update call through agent-js to a particular endpoint of my own canister. The error happened because my own function trapped, meaning the trap function I implemented trapped as expected. In this context, receiving an error message stating that the ic0.trap system API trapped felt totally unrelated to me.
My JS function, my canister, my endpoint, my trap, but a third-party error message.
Note that I’m not arguing, just trying to explain why I was surprised. At the end of the day, I don’t really care about it, and I guess I’m probably the only one who noticed it, so be it.
Pretty sure it’s always been there We haven’t changed this in a veryyyy long time.
My JS function, my canister, my endpoint, my trap, but a third-party error message.
I’m confused. What’s the third party here? The message is telling you the precise reason your call failed: the canister called the trap system API. If that’s the expected behaviour (because as you said you wrote the function/canister), then even better right? The error message confirms what you would expect to happen if you expect your canister to trap for the given input.