Error messages not showing in toolbar (vibe-kanban) (#274)
* ## Summary
I've successfully fixed the error message display issue. Here's what I found and changed:
**The Problem:**
- The backend was correctly returning detailed error messages in the API response format: `{"success": false, "data": null, "message": "Git service error: Merge conflicts: Rebase failed due to conflicts. Please resolve conflicts manually."}`
- The frontend's API layer was correctly parsing these errors and throwing `ApiError` objects with the proper message
- However, the rebase handlers in [`CurrentAttempt.tsx`](file:///private/var/folders/kr/jdxkcn7129j376nrg0stj9zm0000gn/T/vibe-kanban/vk-30d8-error-mess/frontend/src/components/tasks/Toolbar/CurrentAttempt.tsx#L349) were catching these errors and replacing them with generic "Failed to rebase branch" messages
**The Solution:**
- Updated both rebase error handlers to preserve the actual error message: `setError(err instanceof Error ? err.message : 'Failed to rebase branch')`
- This ensures that detailed error messages like "Git service error: Merge conflicts: Rebase failed due to conflicts. Please resolve conflicts manually." will now be displayed to users instead of the generic message
**Result:**
- Users will now see helpful, specific error messages when rebase operations fail
- The response structure is consistent (`success: false` with detailed `message`)
- Both frontend and backend build successfully
The fix is minimal and focused - it preserves the existing API structure while ensuring error messages flow through to the UI properly.
* fmt
* clippy
This commit is contained in:
committed by
GitHub
parent
4a83e6b7fa
commit
f9041aecd8
@@ -346,7 +346,7 @@ function CurrentAttempt({
|
||||
// Refresh branch status after rebase
|
||||
fetchBranchStatus();
|
||||
} catch (err) {
|
||||
setError('Failed to rebase branch');
|
||||
setError(err instanceof Error ? err.message : 'Failed to rebase branch');
|
||||
} finally {
|
||||
setRebasing(false);
|
||||
}
|
||||
@@ -367,7 +367,7 @@ function CurrentAttempt({
|
||||
fetchBranchStatus();
|
||||
setShowRebaseDialog(false);
|
||||
} catch (err) {
|
||||
setError('Failed to rebase branch');
|
||||
setError(err instanceof Error ? err.message : 'Failed to rebase branch');
|
||||
} finally {
|
||||
setRebasing(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user