From c03d119b56c047f244479bb6d4697e5f06da3ea3 Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Tue, 7 Mar 2017 09:53:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3404=20url=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/arialyy/aria/core/download/DownloadUtil.java | 5 ++++- .../main/java/com/arialyy/aria/core/upload/UploadUtil.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Aria/src/main/java/com/arialyy/aria/core/download/DownloadUtil.java b/Aria/src/main/java/com/arialyy/aria/core/download/DownloadUtil.java index d5fd4e86..9ea43928 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/download/DownloadUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/core/download/DownloadUtil.java @@ -225,8 +225,11 @@ final class DownloadUtil implements IDownloadUtil, Runnable { mListener.supportBreakpoint(false); Log.w(TAG, "该下载链接不支持断点下载"); handleBreakpoint(conn); + } else if (code == HttpURLConnection.HTTP_NOT_FOUND) { + Log.w(TAG, "任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,错误码:404"); + mListener.onCancel(); } else { - failDownload("任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,返回码:" + code); + failDownload("任务【" + mDownloadEntity.getDownloadUrl() + "】下载失败,错误码:" + code); } } catch (IOException e) { failDownload("下载失败【downloadUrl:" diff --git a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java index 309594d7..97b8eb0b 100644 --- a/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java +++ b/Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java @@ -216,6 +216,7 @@ final class UploadUtil implements Runnable { mHttpConn.disconnect(); } else { Log.w(TAG, "state_code = " + status); + mListener.onFail(); } writer.flush(); From 2f5546a9f5d95b2b8fb6cc760f78ea3ff3dd87ed Mon Sep 17 00:00:00 2001 From: AriaLyy <511455842@qq.com> Date: Wed, 8 Mar 2017 14:48:54 +0800 Subject: [PATCH 2/2] .. --- .idea/modules.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.idea/modules.xml b/.idea/modules.xml index 5f6de159..9f4bd159 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - +