1
0
Fork 0

Setup and teardown of foxx apps and foxx dev apps should now print their errors properly

This commit is contained in:
Michael Hackstein 2014-12-18 10:46:54 +01:00
parent 4b49179b0e
commit ac1d0e37c1
1 changed files with 43 additions and 68 deletions

View File

@ -171,8 +171,8 @@ function checkManifest (filename, mf) {
if (failed) {
throw new ArangoError({
errorNum: errors.MANIFEST_FILE_ATTRIBUTE_MISSING.code,
errorMessage: errors.MANIFEST_FILE_ATTRIBUTE_MISSING.message
errorNum: errors.ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING.code,
errorMessage: errors.ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING.message
});
}
@ -1596,47 +1596,21 @@ exports.developmentRoutes = function () {
for (j = 0; j < files.length; ++j) {
m = fs.join(root, files[j], "manifest.json");
mf = validateManifestFile(m);
if (mf !== undefined) {
if (fs.exists(m)) {
try {
mf = JSON.parse(fs.read(m));
} catch (err) {
console.errorLines(
"Cannot parse app manifest '%s': %s", m, String(err));
continue;
}
try {
checkManifest(m, mf);
} catch (err) {
console.errorLines(
"Manifest file '%s' invalid: %s", m, String(err));
continue;
}
appId = "dev:" + mf.name + ":" + files[j];
mount = "/dev/" + files[j];
options = {
collectionPrefix : prefixFromMount(mount)
};
app = createApp(appId, options, mf.name, m);
if (app !== undefined) {
try {
app = module.createApp(appId, options);
} catch (err) {
console.errorLines(
"Failed to create App '%s' with manifest '%s': %s", mf.name, m, String(err));
continue;
}
if (app === null) {
console.errorLines(
"Cannot find application '%s'", appId);
continue;
}
try {
// TODO check
setupApp(app, mount, options.collectionPrefix);
} catch (err) {
console.errorLines(
"Setup of App '%s' with manifest '%s' failed: %s", m, String(err));
"Setup of App '%s' with manifest '%s' failed: %s", mf.name, m, String(err));
continue;
}
@ -1672,6 +1646,7 @@ exports.developmentRoutes = function () {
mounts.push(desc);
}
}
}
DEVELOPMENTMOUNTS = mounts;