abstracting error reporting