typing rules
Changed exceptions to errors to avoid "throwing" declarations