REPO-1713: V1 REST API - simplify exception handling for multi-part upload

- was: exceptions from behaviour beans are being returned as 500 during upload (as per RM extended use-case)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133603 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2016-12-13 11:11:56 +00:00
parent fe3eec905c
commit 337d7a9c8c
3 changed files with 14 additions and 17 deletions

View File

@@ -2937,25 +2937,16 @@ public class NodesImpl implements Nodes
// Do not clean formData temp files to allow for retries.
// Temp files will be deleted later when GC call DiskFileItem#finalize() method or by temp file cleaner.
}
catch (ApiException apiEx)
{
// As this is an public API fwk exception, there is no need to convert it, so just throw it.
throw apiEx;
}
catch (AccessDeniedException ade)
{
throw new PermissionDeniedException(ade.getMessage());
}
catch (Exception ex)
{
/*
* NOTE: Do not clean formData temp files to allow for retries. It's
* possible for a temp file to remain if max retry attempts are
* made, but this is rare, so leave to usual temp file cleanup.
*/
throw new ApiException("Unexpected error occurred during upload of new content.", ex);
}
/*
* NOTE: Do not clean formData temp files to allow for retries. It's
* possible for a temp file to remain if max retry attempts are
* made, but this is rare, so leave to usual temp file cleanup.
*/
}
private NodeRef createNewFile(NodeRef parentNodeRef, String fileName, QName nodeType, Content content, Map<QName, Serializable> props, QName assocTypeQName, Parameters params,