if ( $value != $expected_value ) { $errorcount++; die new Exception msg => "argh!"; } else { # continue with the happy path }