better error handling with ConnectionException