mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 14:19:32 +00:00
better error message
This commit is contained in:
parent
cfb619aaad
commit
227d32d1c0
@ -158,16 +158,23 @@ class CTCloudHttpClient {
|
|||||||
// Parse Response
|
// Parse Response
|
||||||
if (classType != null) {
|
if (classType != null) {
|
||||||
HttpEntity entity = response.getEntity();
|
HttpEntity entity = response.getEntity();
|
||||||
|
if (entity != null) {
|
||||||
String entityStr = EntityUtils.toString(entity);
|
String entityStr = EntityUtils.toString(entity);
|
||||||
|
if (StringUtils.isNotBlank(entityStr)) {
|
||||||
O respObj = mapper.readValue(entityStr, classType);
|
O respObj = mapper.readValue(entityStr, classType);
|
||||||
return respObj;
|
return respObj;
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
} else {
|
} else {
|
||||||
LOGGER.log(Level.WARNING, "Response Received. - Status Error {}", response.getStatusLine());
|
LOGGER.log(Level.WARNING, "Response Received. - Status Error {}", response.getStatusLine());
|
||||||
handleNonOKResponse(response, "");
|
handleNonOKResponse(response, "");
|
||||||
}
|
}
|
||||||
|
// transform all non-CTCloudException's into a CTCloudException
|
||||||
|
} catch (CTCloudException ex) {
|
||||||
|
throw ex;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOGGER.log(Level.WARNING, "Error when parsing response from CyberTriage Cloud", ex);
|
LOGGER.log(Level.WARNING, "Error when parsing response from CyberTriage Cloud", ex);
|
||||||
throw new CTCloudException(CTCloudException.parseUnknownException(ex), ex);
|
throw new CTCloudException(CTCloudException.parseUnknownException(ex), ex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user