add raise exception statements