GUACAMOLE-1571: Properly wrap upload stream JSON errors.

This commit is contained in:
James Muehlner
2022-03-30 23:55:17 +00:00
committed by Mike Jumper
parent ff4854d8f7
commit 77bd5e116a

View File

@@ -316,7 +316,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)