# trap

This section is a work in progress.

Examples:

- cross_canister_calls
- ethereum_json_rpc
- http_counter
- ic_api
- outgoing_http_requests
- threshold_ecdsa

    import { bool, Canister, ic, query, text } from 'azle';

    export default Canister({
        // traps with a message, stopping execution and discarding all state within the call
        trap: query([text], bool, (message) => {
            ic.trap(message);

            return true;
        })
    });