mirror of https://gitee.com/bigwinds/arangodb
Started to tear appart the error handling in current devel mode. It will now print with a much closer relation to their source
This commit is contained in:
parent
6feed25079
commit
8300296679
|
@ -171,8 +171,8 @@ function checkManifest (filename, mf) {
|
|||
|
||||
if (failed) {
|
||||
throw new ArangoError({
|
||||
errorNum: errors.ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING.code,
|
||||
errorMessage: errors.ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING.message
|
||||
errorNum: errors.MANIFEST_FILE_ATTRIBUTE_MISSING.code,
|
||||
errorMessage: errors.MANIFEST_FILE_ATTRIBUTE_MISSING.message
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1596,21 +1596,47 @@ 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", mf.name, m, String(err));
|
||||
"Setup of App '%s' with manifest '%s' failed: %s", m, String(err));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1646,7 +1672,6 @@ exports.developmentRoutes = function () {
|
|||
mounts.push(desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEVELOPMENTMOUNTS = mounts;
|
||||
|
||||
|
|
|
@ -343,6 +343,15 @@ SIMPLE_CLIENT_COULD_NOT_CONNECT,2001,"could not connect to server","Will be rais
|
|||
SIMPLE_CLIENT_COULD_NOT_WRITE,2002,"could not write to server","Will be raised when the client could not write data."
|
||||
SIMPLE_CLIENT_COULD_NOT_READ,2003,"could not read from server","Will be raised when the client could not read data."
|
||||
|
||||
|
||||
################################################################################
|
||||
## Foxx Manager
|
||||
################################################################################
|
||||
|
||||
MALFORMED_MANIFEST_FILE,3000,"malformed manifest file","The Manifest file is malformed. It is not in a valid JSON format."
|
||||
MANIFEST_FILE_ATTRIBUTE_MISSING,3001,"missing manifest attribute","The Manifest file is incomplete. A required attribute is missing."
|
||||
|
||||
|
||||
################################################################################
|
||||
## results, which are not errors
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue