fix(git): improve error reporting and resolve correct repo in GET endpoint

This commit is contained in:
2026-04-28 16:54:57 +05:00
parent 0c5b58e26b
commit 699e6bbe9f
2 changed files with 14 additions and 10 deletions
+6 -6
View File
@@ -64,9 +64,9 @@ export async function ensureRepo(owner: string, repoName: string, description =
}
})
return true
} catch (e) {
console.error(`Gitea ensureRepo(${owner}/${repoName}) error:`, e)
return false
} catch (e: any) {
console.error(`Gitea ensureRepo(${owner}/${repoName}) error:`, e.data || e)
throw new Error(`ensureRepo failed: ${e.message}`)
}
}
@@ -103,9 +103,9 @@ export async function giteaPutFile(path: string, content: string, message: strin
}
})
return true
} catch (e) {
console.error('Gitea putFile error:', e)
return false
} catch (e: any) {
console.error('Gitea putFile error:', e.data || e)
throw new Error(`giteaPutFile failed: ${e.message}`)
}
}