fix(gitea) : propagate API errors instead of silently returning empty results

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 18:58:55 +01:00
parent 63e4af785e
commit 4c19b68156
5 changed files with 36 additions and 11 deletions

View File

@@ -61,7 +61,7 @@
<!-- Error state -->
<div v-if="error" class="px-4 py-3">
<p class="text-xs text-red-500">{{ $t('gitea.error') }}</p>
<p class="text-xs text-red-500">{{ error }}</p>
</div>
<!-- Create branch form (inline) -->
@@ -248,7 +248,7 @@ const pullRequests = ref<GiteaPullRequest[]>([])
const isLoading = ref(true)
const isLoadingPrs = ref(true)
const isCreating = ref(false)
const error = ref(false)
const error = ref('')
const showCreateForm = ref(false)
const expandedBranches = ref(new Set<string>())
@@ -338,7 +338,7 @@ async function loadData() {
isLoading.value = true
isLoadingPrs.value = true
error.value = false
error.value = ''
try {
branches.value = await listBranches(props.task.id)
@@ -346,8 +346,8 @@ async function loadData() {
if (branches.value.length === 1) {
expandedBranches.value.add(branches.value[0].name)
}
} catch {
error.value = true
} catch (e: any) {
error.value = e?.data?.detail || e?.data?.['hydra:description'] || t('gitea.error')
} finally {
isLoading.value = false
}