Replacing logger with general error