Review Board 1.7.22

Common Container should log detailed error messages when a gadget fails to navigate or preload

Review Request #4738 - Created April 16, 2012 and submitted

Stanton Sievers
I'm always up for recommendations on how to best log these details.  I considered refactoring this logging to get some re-use.  Does anyone think it's worth it?

From JIRA:

If in the process of preloading or navigating a gadget something fails, the common container will log warnings, "Failed to preload gadget <gadget url>." and "Failed to navigate for gadget <gadget url>.", respectively. However, it only logs these errors upon the existence of the "error" object in the response. It does not log any of the information contained within the "error" object.

The proposed improvement would be to log the detailed information in the "error" object. This includes both the HTTP status code and a detailed message. This information is more usable when trying to determine the root cause of the error. 
Tested in the sample common container page.  Executed "Preload and Add", "Add only", and "Preload only" actions for a gadget url that didn't exist.  Verified that the detailed 404 message was logged in all cases.

"Detailed error: 404 Unable to retrieve spec for http://localhost:8080/samplecontainer/examples/NonExistent.xml. HTTP error 404"
Posted (April 16, 2012, 6:30 p.m.)
I think I personally prefer logging the whole message once at the warn level.
+1 for the change to add more details to the message, though.
Ship it!
Posted (April 16, 2012, 7:53 p.m.)
Ship it!
Posted (April 19, 2012, 4:43 p.m.)
Committed revision 1328043.