Fix error message for has_error

Fix argument count in has_error.
Fix error message when an error is expected, but no error is caught.