Minor improvements

This commit is contained in:
Alexander Cerutti
2018-12-12 20:39:17 +01:00
parent e57f08d605
commit 27339bfdac

View File

@@ -58,9 +58,7 @@ class Pass {
// May have not used this catch but ENOENT error is not enough self-explanatory // May have not used this catch but ENOENT error is not enough self-explanatory
// in the case of internal usage () // in the case of internal usage ()
if (err.code && err.code === "ENOENT") { if (err.code && err.code === "ENOENT") {
let eMessage = formatError("MODEL_NOT_FOUND", this.model); throw new Error(formatError("MODEL_NOT_FOUND", this.model));
throw new Error(eMessage);
} }
throw new Error(err); throw new Error(err);
@@ -70,9 +68,8 @@ class Pass {
return [filesList, [], []]; return [filesList, [], []];
} }
let buffersPromise = [ let buffersPromise = this._remoteResources.map((r) => {
...this._remoteResources.map((r) => return got(r[0], { encoding: null })
got(r[0], { encoding: null })
.then(response => { .then(response => {
loadDebug(`Picture MIME-type: ${response.headers["content-type"]}`); loadDebug(`Picture MIME-type: ${response.headers["content-type"]}`);
@@ -90,9 +87,8 @@ class Pass {
loadDebug(`Was not able to fetch resource ${r[1]}. Error: ${e}`); loadDebug(`Was not able to fetch resource ${r[1]}. Error: ${e}`);
// here we are adding undefined values, that will be removed later. // here we are adding undefined values, that will be removed later.
return undefined; return undefined;
}) });
) });
];
// forwarding model files list, remote files list and remote buffers. // forwarding model files list, remote files list and remote buffers.
return [ return [