adds error details in case of failure