GUACAMOLE-926: Reject file-level errors in csv parser to ensure proper bubbling.

This commit is contained in:
James Muehlner
2023-05-02 19:54:53 +00:00
parent f198cb356f
commit 00fc4b4270

View File

@@ -389,17 +389,17 @@ angular.module('import').factory('connectionCSVService',
// Fail if the name wasn't provided. Note that this is a file-level
// error, not specific to any connection.
if (!nameGetter)
throw new ParseError({
deferred.reject(new ParseError({
message: 'The connection name must be provided',
key: 'IMPORT.ERROR_REQUIRED_NAME_FILE'
});
}));
// Fail if the protocol wasn't provided
if (!protocolGetter)
throw new ParseError({
deferred.reject(new ParseError({
message: 'The connection protocol must be provided',
key: 'IMPORT.ERROR_REQUIRED_PROTOCOL_FILE'
});
}));
// The function to transform a CSV row into a connection object
deferred.resolve(function transformCSVRow(row) {