Skip to content

Commit feef719

Browse files
author
Adam Rutland
authored
Merge pull request #158 from vlocityinc/fix
Fix exception when unknown error.
2 parents 3d6cbc9 + de4c3c7 commit feef719

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/datapackserrorhandling.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ DataPacksErrorHandling.prototype.getSanitizedErrorMessage = async function(jobIn
2929
}
3030

3131
if (!newErrorMessage) {
32-
newErrorMessage = `${dataPack.VlocityDataPackKey} - ${errorMessage}`;
32+
if (errorMessage) {
33+
newErrorMessage = `${dataPack.VlocityDataPackKey} - ${errorMessage}`;
34+
} else {
35+
newErrorMessage = `${dataPack.VlocityDataPackKey} - Unknown Error`;
36+
}
3337
} else {
3438
newErrorMessage = this.vlocity.utilityservice.setNamespaceToOrg(newErrorMessage);
3539

@@ -49,6 +53,11 @@ DataPacksErrorHandling.prototype.getSanitizedErrorMessage = async function(jobIn
4953
};
5054

5155
DataPacksErrorHandling.prototype.getMatchingError = function(errorMessage, dataPackWithError) {
56+
57+
if (!errorMessage) {
58+
return;
59+
}
60+
5261
for (var key in this.errorHandlingDefinition) {
5362
var obj = this.errorHandlingDefinition[key];
5463
var dataPackTypeMatch = false;

0 commit comments

Comments
 (0)