capture an error scenario as a test