mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 21:25:26 +00:00
Added error check inside pass.json reading block
This commit is contained in:
12
index.js
12
index.js
@@ -113,7 +113,17 @@ class Pass {
|
||||
// Otherwise would had to put everything in editPassStructure's Promise .then().
|
||||
async.parallel([
|
||||
passCallback => {
|
||||
fs.readFile(path.resolve(this.modelDirectory, `${this.modelName}.pass`, "pass.json"), {}, (err, passStructBuffer) => {
|
||||
fs.readFile(path.resolve(computedModelPath, "pass.json"), {}, (err, passStructBuffer) => {
|
||||
if (err) {
|
||||
// Flow should never enter in there since pass.json existence-check is already done above.
|
||||
return passCallback({
|
||||
status: false,
|
||||
error: {
|
||||
message: `Unable to read pass.json file @ ${computedModelPath}`
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!this._validateType(passStructBuffer)) {
|
||||
return passCallback({
|
||||
status: false,
|
||||
|
||||
Reference in New Issue
Block a user