Catching the IOException and checking for the error text is one option. There seem to be others which are less brittle.
See https://issues.jboss.org/browse/AEROGEAR-848
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira