Add logging for error