Optionally raise exceptions in addition to silently setting an error code.