Skip to content

Commit b30a2c6

Browse files
committed
Merge pull request android-async-http#27 from scottanderson/json-parsing-failure
Call onFailure() when response is not valid JSON
2 parents 622bf04 + da76755 commit b30a2c6

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<classpathentry kind="src" path="src"/>
55
<classpathentry kind="src" path="gen"/>
66
<classpathentry kind="src" path="examples"/>
7-
<classpathentry kind="output" path="bin"/>
7+
<classpathentry kind="output" path="bin/classes"/>
88
</classpath>

build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<project default="package">
22
<property file="local.properties"/>
3-
<property file="default.properties"/>
3+
<property file="project.properties"/>
44

55
<!-- Package properties -->
66
<property name="package.name" value="android-async-http" />
@@ -68,4 +68,4 @@
6868

6969
<!-- Compile and package a jar -->
7070
<target name="package" depends="compile,jar" />
71-
</project>
71+
</project>

default.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

project.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
android.library=true
11+
# Project target.
12+
target=android-3

src/com/loopj/android/http/JsonHttpResponseHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ protected void handleSuccessMessage(String responseBody) {
6969
onSuccess((JSONObject)jsonResponse);
7070
} else if(jsonResponse instanceof JSONArray) {
7171
onSuccess((JSONArray)jsonResponse);
72+
} else {
73+
throw new JSONException("Unexpected type " + jsonResponse.getClass().getName());
7274
}
7375
} catch(JSONException e) {
7476
onFailure(e, responseBody);

0 commit comments

Comments
 (0)