Catch correct error type.