Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Handle HTTP status code errors #8

Open
inghamn opened this issue Dec 7, 2012 · 3 comments
Open

Handle HTTP status code errors #8

inghamn opened this issue Dec 7, 2012 · 3 comments
Assignees
Labels

Comments

@inghamn
Copy link
Member

inghamn commented Dec 7, 2012

During GET and POST, the endpoints may spit ouu various HTTP status codes as error messages. Right now, we do not have any status code error checking. We need to add checks for status code errors during Open311.loadStringFromUrl and Open311.postServiceRequest

@ghost ghost assigned inghamn Dec 7, 2012
@inghamn
Copy link
Member Author

inghamn commented Dec 8, 2012

I need to figure out how best to trap various types of exceptions that can happen and display different Dialog messages. Also, depending on the type of exception, we may want to not display any Dialog message to the user.. we may just want to do something instead.

public static String loadStringFromUrl(String url)
        throws ClientProtocolException, IOException, IllegalStateException, HttpResponseException {
    ResponseHandler<String> handler = new BasicResponseHandler();
    return getClient().execute(new HttpGet(url), handler);
}

@inghamn
Copy link
Member Author

inghamn commented Dec 13, 2012

Updated POST Service Request to handle HTTP Status Codes by sending a new Open311Exception with custom errorMessage.

01913ee

@inghamn
Copy link
Member Author

inghamn commented Dec 18, 2012

POST is doing it right. Now, we just need to take a look at GET Service List, GET Service Definition calls.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant