handle devchat not found error
This commit is contained in:
parent
94413e6f1f
commit
8dcc4e4a6e
@ -2,7 +2,7 @@
|
|||||||
"name": "devchat",
|
"name": "devchat",
|
||||||
"displayName": "DevChat",
|
"displayName": "DevChat",
|
||||||
"description": "Write prompts, not code",
|
"description": "Write prompts, not code",
|
||||||
"version": "0.0.42",
|
"version": "0.0.45",
|
||||||
"icon": "assets/devchat.png",
|
"icon": "assets/devchat.png",
|
||||||
"publisher": "merico",
|
"publisher": "merico",
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -23,6 +23,7 @@
|
|||||||
"dist/*",
|
"dist/*",
|
||||||
"bin/*",
|
"bin/*",
|
||||||
"assets/*",
|
"assets/*",
|
||||||
|
"tools/*",
|
||||||
"workflows/*",
|
"workflows/*",
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"README.md"
|
"README.md"
|
||||||
|
@ -80,6 +80,18 @@ class DevChat {
|
|||||||
reject({ code, stdout, stderr });
|
reject({ code, stdout, stderr });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add error event listener to handle command not found exception
|
||||||
|
this.childProcess.on('error', (error: any) => {
|
||||||
|
if (error.code === 'ENOENT') {
|
||||||
|
logger.channel()?.error(`Command not found: ${command}`);
|
||||||
|
logger.channel()?.show();
|
||||||
|
} else {
|
||||||
|
logger.channel()?.error(`Error occurred: ${error.message}`);
|
||||||
|
logger.channel()?.show();
|
||||||
|
}
|
||||||
|
reject({ code: error.code, stdout: "", stderr: error.message });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -290,6 +302,7 @@ class DevChat {
|
|||||||
},
|
},
|
||||||
}, (partialResponse: string) => { });
|
}, (partialResponse: string) => { });
|
||||||
|
|
||||||
|
logger.channel()?.info(`Finish devchat with args: ${args.join(" ")}`);
|
||||||
if (stderr) {
|
if (stderr) {
|
||||||
logger.channel()?.error(`Error getting log: ${stderr}`);
|
logger.channel()?.error(`Error getting log: ${stderr}`);
|
||||||
logger.channel()?.show();
|
logger.channel()?.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user