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] =?UTF-8?q?=E4=BF=AE=E6=AD=A3404=20url=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=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();