There doesn't seem to be a way to retrieve response data for when a connection fails

In the app that I'm developing, on connection fail I need a way to access the response data to know what error message to display.  

This is my addition to the library to bypass the issue.  Alternatively if there exist a way to do so in the current version, would be great if you can point me in the right direction.  Appreciate it!