Add error logging to DevChat child process

- Check for stderr in the 'close' event
- Log the error to the logger channel
- Show the logger channel if an error occurs
This commit is contained in:
bobo.yang 2023-05-18 17:37:44 +08:00
parent 4cc02b65c0
commit 2c94bd2f1f

View File

@ -69,6 +69,11 @@ class DevChat {
});
this.childProcess.on('close', (code: number) => {
if (stderr) {
logger.channel()?.error(stderr);
logger.channel()?.show();
}
if (code === 0) {
resolve({ code, stdout, stderr });
} else {