mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-07 09:23:00 +02:00
fix: add error handling in getSettings method of GitListener
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -69,16 +69,21 @@ export class GitListener {
|
||||
const gitActions = Settings.get<boolean>(SETTING_GIT_ENABLED);
|
||||
if (gitActions) {
|
||||
Logger.verbose('GitListener:getSettings:end:enabled');
|
||||
return {
|
||||
isGitRepo: gitActions ? await GitListener.isGitRepository() : false,
|
||||
actions: gitActions || false,
|
||||
disabledBranches: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_DISABLED_BRANCHES) || []
|
||||
: [],
|
||||
requiresCommitMessage: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_REQUIRES_COMMIT_MSG) || []
|
||||
: []
|
||||
};
|
||||
try {
|
||||
return {
|
||||
isGitRepo: gitActions ? await GitListener.isGitRepository() : false,
|
||||
actions: gitActions || false,
|
||||
disabledBranches: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_DISABLED_BRANCHES) || []
|
||||
: [],
|
||||
requiresCommitMessage: gitActions
|
||||
? Settings.get<string[]>(SETTING_GIT_REQUIRES_COMMIT_MSG) || []
|
||||
: []
|
||||
};
|
||||
} catch (e) {
|
||||
Logger.error((e as Error).message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.verbose('GitListener:getSettings:end:disabled');
|
||||
|
||||
Reference in New Issue
Block a user