Properly wrap upload stream JSON errors.
@@ -323,7 +323,7 @@ angular.module('rest').factory('tunnelService', ['$injector',
// Parse and reject with resulting JSON error
else if (xhr.getResponseHeader('Content-Type') === 'application/json')
- deferred.reject(angular.fromJson(xhr.responseText));
+ deferred.reject(new Error(angular.fromJson(xhr.responseText)));
// Warn of lack of permission of a proxy rejects the upload
else if (xhr.status >= 400 && xhr.status < 500)
