Throw an error when performRequest fails

When performRequest fails, the user/developper gets no clue about what happened.
performRequest now throws an exception with the error returned by curl.