mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-24 02:05:25 +00:00
fix(gitlab): Better error logs for gitlab config sync (#692)
This commit is contained in:
parent
84e53c8576
commit
1e5cf7c8bf
2 changed files with 19 additions and 13 deletions
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Changed
|
||||
- Bake Sourcebot version into code rather than relying on build arg. [#680](https://github.com/sourcebot-dev/sourcebot/pull/680)
|
||||
- Fix issue with `/repos` page pagination. [#689](https://github.com/sourcebot-dev/sourcebot/pull/689)
|
||||
- Add better logs for gitlab config sync fails. [#692](https://github.com/sourcebot-dev/sourcebot/pull/692)
|
||||
|
||||
## [4.10.4] - 2025-12-18
|
||||
|
||||
|
|
|
|||
|
|
@ -97,14 +97,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
|||
logger.error(`Failed to fetch projects for group ${group}.`, e);
|
||||
|
||||
const status = e?.cause?.response?.status;
|
||||
if (status === 404) {
|
||||
const warning = `Group ${group} not found or no access`;
|
||||
logger.warn(warning);
|
||||
if (status !== undefined) {
|
||||
const warning = `GitLab API returned ${status}`
|
||||
logger.warning(warning);
|
||||
return {
|
||||
type: 'warning' as const,
|
||||
warning
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
logger.error("No API response status returned");
|
||||
throw e;
|
||||
}
|
||||
}));
|
||||
|
|
@ -135,14 +137,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
|||
logger.error(`Failed to fetch projects for user ${user}.`, e);
|
||||
|
||||
const status = e?.cause?.response?.status;
|
||||
if (status === 404) {
|
||||
const warning = `User ${user} not found or no access`;
|
||||
logger.warn(warning);
|
||||
if (status !== undefined) {
|
||||
const warning = `GitLab API returned ${status}`
|
||||
logger.warning(warning);
|
||||
return {
|
||||
type: 'warning' as const,
|
||||
warning
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
logger.error("No API response status returned");
|
||||
throw e;
|
||||
}
|
||||
}));
|
||||
|
|
@ -171,15 +175,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
|||
logger.error(`Failed to fetch project ${project}.`, e);
|
||||
|
||||
const status = e?.cause?.response?.status;
|
||||
|
||||
if (status === 404) {
|
||||
const warning = `Project ${project} not found or no access`;
|
||||
logger.warn(warning);
|
||||
if (status !== undefined) {
|
||||
const warning = `GitLab API returned ${status}`
|
||||
logger.warning(warning);
|
||||
return {
|
||||
type: 'warning' as const,
|
||||
warning
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
logger.error("No API response status returned");
|
||||
throw e;
|
||||
}
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in a new issue