diff --git a/src/main/java/com/hcl/appscan/sdk/scan/ASEScanServiceProvider.java b/src/main/java/com/hcl/appscan/sdk/scan/ASEScanServiceProvider.java index 10382936..f6e8ba2a 100644 --- a/src/main/java/com/hcl/appscan/sdk/scan/ASEScanServiceProvider.java +++ b/src/main/java/com/hcl/appscan/sdk/scan/ASEScanServiceProvider.java @@ -244,9 +244,14 @@ private Boolean updateTrafficJob(File file, String jobId, String action) { HttpResponse response = client.postMultipart(request_url, request_headers, parts); int status = response.getResponseCode(); if (status != HttpsURLConnection.HTTP_OK) { - return false; + JSONObject json = (JSONObject) response.getResponseBodyAsJSON(); + if(json != null && json.has("errorMessage")){ + String errorResponse = json.getString("errorMessage"); + m_progress.setStatus(new Message(Message.ERROR, errorResponse)); + } + return false; } - } catch(IOException e) { + } catch(IOException | JSONException e) { m_progress.setStatus(new Message(Message.ERROR, Messages.getMessage(ERROR_UPDATE_JOB, e.getLocalizedMessage()))); return false; }