You should probably JSON-decode the body, and verify that the 'error' field is a string-match for the expected string, rather than just hoping the raw form is correct. :)