Move the error reporting inside the module