Only add error arguments if there is an error

Hello @chaosgame, 

Please review the following commits I made in branch 'jamie-error-failure'.

cc961797c5e5bbf52da82e41e3cb7b4fbbfb4264 (2014-07-28 16:57:21 -0700)
Only add error arguments if there is an error

R=@chaosgame