added more logging when error occurs, including request details