|
15 | 15 | */ |
16 | 16 | package com.jd.live.agent.governance.service.sync.http; |
17 | 17 |
|
18 | | -import com.jd.live.agent.governance.config.SyncConfig; |
19 | 18 | import com.jd.live.agent.core.instance.Application; |
20 | 19 | import com.jd.live.agent.core.parser.ObjectReader.StringReader; |
21 | 20 | import com.jd.live.agent.core.util.Close; |
22 | 21 | import com.jd.live.agent.core.util.Daemon; |
23 | 22 | import com.jd.live.agent.core.util.Waiter; |
24 | 23 | import com.jd.live.agent.core.util.http.HttpResponse; |
25 | 24 | import com.jd.live.agent.core.util.http.HttpUtils; |
| 25 | +import com.jd.live.agent.governance.config.SyncConfig; |
26 | 26 | import com.jd.live.agent.governance.service.sync.SyncKey.HttpSyncKey; |
27 | 27 | import com.jd.live.agent.governance.service.sync.SyncResponse; |
28 | 28 | import com.jd.live.agent.governance.service.sync.SyncStatus; |
@@ -142,15 +142,15 @@ protected void request(HttpResource resource, HttpListener listener) { |
142 | 142 | listener.onUpdate(new HttpWatchEvent(EventType.UPDATE, resource.getId(), response.getData())); |
143 | 143 | break; |
144 | 144 | case NOT_FOUND: |
145 | | - listener.onUpdate(new HttpWatchEvent(resource.getId(), new IOException("Failed to request " + resource + ", caused by it's not found."))); |
| 145 | + listener.onUpdate(new HttpWatchEvent(resource.getId(), new IOException("Failed to request " + resource.getUrl() + ", caused by it's not found."))); |
146 | 146 | case NOT_MODIFIED: |
147 | 147 | break; |
148 | 148 | default: |
149 | | - listener.onUpdate(new HttpWatchEvent(resource.getId(), new IOException("Failed to request " + resource + ", caused by " + response.getMessage()))); |
| 149 | + listener.onUpdate(new HttpWatchEvent(resource.getId(), new IOException("Failed to request " + resource.getUrl() + ", caused by " + response.getMessage()))); |
150 | 150 | break; |
151 | 151 | } |
152 | 152 | } catch (IOException e) { |
153 | | - listener.onUpdate(new HttpWatchEvent(resource.getId(), e)); |
| 153 | + listener.onUpdate(new HttpWatchEvent(resource.getId(), new IOException("Failed to request " + resource.getUrl() + ", caused by " + e.getMessage(), e))); |
154 | 154 | } |
155 | 155 | } |
156 | 156 |
|
|
0 commit comments