Ensure response.error is populated correctly.

Hi @fiorix (and @dpnova),

Simple fix for #161. Let me know what you think.