Add logging of errors