Refactor error handling

6 jobs for andrey/refactor_errors in 43 seconds (queued for 29 seconds)