Improve error handling in DevChat dependency check
- Add a catch block to handle errors when checking pipx environment path. - Log detailed error message when DevChat dependency check fails. - Move DevChat installation check to a separate try-catch block. - Update logger error message to info when pipx environment path is not found.
This commit is contained in:
parent
9820571783
commit
1bb215f51b
@ -13,13 +13,17 @@ export function checkDevChatDependency(pythonCommand: string): boolean {
|
|||||||
} else {
|
} else {
|
||||||
logger.channel()?.info(`Failed to obtain the pipx environment path.`);
|
logger.channel()?.info(`Failed to obtain the pipx environment path.`);
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// DevChat dependency check failed
|
||||||
|
// log out detail error message
|
||||||
|
logger.channel()?.info(`Failed to check DevChat dependency due to error: ${error}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Check if DevChat is installed
|
// Check if DevChat is installed
|
||||||
runCommand('devchat --help');
|
runCommand('devchat --help');
|
||||||
return true;
|
return true;
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
// DevChat dependency check failed
|
|
||||||
// log out detail error message
|
|
||||||
logger.channel()?.error(`Failed to check DevChat dependency due to error: ${error}`);
|
logger.channel()?.error(`Failed to check DevChat dependency due to error: ${error}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user