Is the `ic_cdk::setup` function vestigial now?

All ic_cdk::setup() does is call into setup_panic_hook.

This does 2 things whenever your code panics.

1 - it calls print, which means you can see the error message when running a local replica.
2 - it calls trap with the error message, this is what adds the error message to the response.

But it looks like you don’t need to explicitly call ic_cdk::setup() since it is included in the code generated by each of the cdk macros (see here).

4 Likes