log an error, if any