Refactoring error reporting