Add specs for error handling helper