1
0
Fork 0

Fixed Foxx installer errors.

This commit is contained in:
Alan Plum 2015-04-08 14:19:38 +02:00
parent 19b14bd98c
commit 4f51343100
2 changed files with 22 additions and 2 deletions

View File

@ -63,8 +63,12 @@ describe("Foxx Manager install", function() {
}
validateError = function(type, error) {
expect(error instanceof ArangoError).toBeTruthy();
expect(error.errorNum).toEqual(type.code, "Invalid code returned: expected " + type.code + " got "
+ error.errorNum + " Message: " + String(error) + " Trace: " + error.stack);
expect(error.errorNum).toEqual(
type.code,
"Invalid code returned: expected " + type.code + " got " + error.errorNum
+ " Message: " + error
+ " Trace: " + error.stack
);
};
});

View File

@ -950,6 +950,7 @@ var _install = function(appInfo, mount, options, runSetup) {
try {
fs.removeDirectoryRecursive(targetPath, true);
} catch (err) {
console.errorLines(err.stack);
}
try {
if (!options.__clusterDistribution) {
@ -964,6 +965,21 @@ var _install = function(appInfo, mount, options, runSetup) {
});
}
} catch (err) {
console.errorLines(err.stack);
}
if (e instanceof ArangoError) {
if (e.errorNum === errors.ERROR_MODULE_SYNTAX_ERROR.code) {
throw _.extend(new ArangoError({
errorNum: errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.code,
errorMessage: errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.message
}), {stack: e.stack});
}
if (e.errorNum === errors.ERROR_MODULE_FAILURE.code) {
throw _.extend(new ArangoError({
errorNum: errors.ERROR_FAILED_TO_EXECUTE_SCRIPT.code,
errorMessage: errors.ERROR_FAILED_TO_EXECUTE_SCRIPT.message
}), {stack: e.stack});
}
}
throw e;
}