File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
src/com/loopj/android/http Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,20 @@ public void run() {
7373
7474 private void makeRequest () throws IOException {
7575 if (!Thread .currentThread ().isInterrupted ()) {
76- HttpResponse response = client .execute (request , context );
77- if (!Thread .currentThread ().isInterrupted ()) {
78- if (responseHandler != null ) {
79- responseHandler .sendResponseMessage (response );
80- }
81- } else {
82- //TODO: should raise InterruptedException? this block is reached whenever the request is cancelled before its response is received
83- }
76+ try {
77+ HttpResponse response = client .execute (request , context );
78+ if (!Thread .currentThread ().isInterrupted ()) {
79+ if (responseHandler != null ) {
80+ responseHandler .sendResponseMessage (response );
81+ }
82+ } else {
83+ //TODO: should raise InterruptedException? this block is reached whenever the request is cancelled before its response is received
84+ }
85+ } catch (IOException e ) {
86+ if (!Thread .currentThread ().isInterrupted ()) {
87+ throw e ;
88+ }
89+ }
8490 }
8591 }
8692
You can’t perform that action at this time.
0 commit comments