Skip to content

Commit 2d875e5

Browse files
authored
Merge pull request #384 from JemyCheung/master
response_error
2 parents f91249c + 559c387 commit 2d875e5

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

library/src/androidTest/java/com/qiniu/android/common/AutoZoneTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public class AutoZoneTest extends AndroidTestCase {
5151
// assertNull(zoneInfo);
5252
// }
5353

54-
public void testSplitE() {
55-
String s1 = "bkt:key";
56-
String s2 = "bkt";
57-
Assert.assertEquals(s1.split(":")[0], s2.split(":")[0]);
58-
}
54+
// public void testSplitE() {
55+
// String s1 = "bkt:key";
56+
// String s2 = "bkt";
57+
// Assert.assertEquals(s1.split(":")[0], s2.split(":")[0]);
58+
// }
5959

6060
public void testC1() {
6161
AutoZone autoZone = new AutoZone();

library/src/main/java/com/qiniu/android/collect/UploadInfoElement.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,16 @@ public long getUp_time() {
510510

511511
public static String resultCode(int statuscode, String error) {
512512
String result = "";
513+
if (statuscode == 406) {
514+
return "checksum_error";
515+
}
516+
if (200 < statuscode && statuscode < 1000) {
517+
return "response_error";
518+
}
513519
switch (statuscode) {
514520
case 200:
515521
result = "ok";
516522
break;
517-
case 406:
518-
result = "checksum_error";
519-
break;
520523
case ResponseInfo.NetworkError:
521524
if (error != null && error.indexOf("but received") != -1) {
522525
result = "file_changed";
@@ -566,7 +569,7 @@ public static String errorType(int statuscode, String error) {
566569
if (statuscode == 406) {
567570
return "checksum_error";
568571
}
569-
if (200 < statuscode && statuscode < 600) {
572+
if (200 < statuscode && statuscode < 1000) {
570573
return "response_error";
571574
}
572575
switch (statuscode) {

0 commit comments

Comments
 (0)