mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
improve error handling for failed git fetch (#5844)
This commit is contained in:
parent
97a4d10048
commit
83f96d5f6d
@ -184,7 +184,14 @@ export const gitFetchAction: ActionFunction = async ({ params }): Promise<GitFet
|
||||
const gitRepository = await models.gitRepository.getById(workspaceMeta?.gitRepositoryId);
|
||||
invariant(gitRepository, 'Git Repository not found');
|
||||
|
||||
await GitVCS.fetch({ singleBranch: true, depth: 1, credentials: gitRepository?.credentials });
|
||||
try {
|
||||
await GitVCS.fetch({ singleBranch: true, depth: 1, credentials: gitRepository?.credentials });
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return {
|
||||
errors: ['Failed to fetch from remote'],
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user