mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix to transfer status since the "error" JSON property is optional.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22463 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -546,15 +546,20 @@ public class HttpClientTransmitterImpl implements TransferTransmitter
|
||||
int currentPosition = statusObj.getInt("currentPosition");
|
||||
int endPosition = statusObj.getInt("endPosition");
|
||||
String statusStr= statusObj.getString("status");
|
||||
|
||||
JSONObject errorJSON = statusObj.getJSONObject("error");
|
||||
Throwable throwable = rehydrateError(errorJSON);
|
||||
|
||||
|
||||
TransferProgress p = new TransferProgress();
|
||||
|
||||
if(statusObj.has("error"))
|
||||
{
|
||||
JSONObject errorJSON = statusObj.getJSONObject("error");
|
||||
Throwable throwable = rehydrateError(errorJSON);
|
||||
p.setError(throwable);
|
||||
}
|
||||
|
||||
p.setStatus(TransferProgress.Status.valueOf(statusStr));
|
||||
p.setCurrentPosition(currentPosition);
|
||||
p.setEndPosition(endPosition);
|
||||
p.setError(throwable);
|
||||
|
||||
return p;
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
|
Reference in New Issue
Block a user