Skip to content

fix: improve error handling by returning specific error messages in skill routes and IPC handlers#945

Merged
vcfgv merged 1 commit intomainfrom
bugfix/expose-actual-skill-installation-error
Apr 30, 2026
Merged

fix: improve error handling by returning specific error messages in skill routes and IPC handlers#945
vcfgv merged 1 commit intomainfrom
bugfix/expose-actual-skill-installation-error

Conversation

@vcfgv
Copy link
Copy Markdown
Contributor

@vcfgv vcfgv commented Apr 30, 2026

Summary

Related Issue(s)

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other

Validation

Checklist

  • I ran relevant checks/tests locally.
  • I updated docs if behavior or interfaces changed.
  • I verified there are no unrelated changes in this PR.

Copilot AI review requested due to automatic review settings April 30, 2026 10:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves skills/marketplace error reporting by propagating more specific error messages from the Electron main process through the skills store to the Skills UI.

Changes:

  • Update skills store error mapping to fall back to normalized error messages when no known timeout/rate-limit translation key applies.
  • Render non-translation search errors directly in the Skills marketplace UI.
  • Return Error.message (vs String(error)) from ClawHub IPC handlers and Host API skills routes for cleaner error payloads.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/stores/skills.ts Adjusts error-key mapping to return null for unknown codes and uses appError.message as fallback.
src/pages/Skills/index.tsx Changes marketplace search error UI to display the raw error string when not a known translation key.
electron/main/ipc-handlers.ts Updates ClawHub IPC handler error serialization to prefer error.message.
electron/api/routes/skills.ts Updates Host API skills/clawhub route error serialization to prefer error.message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 862 to +864
{SEARCH_ERROR_CODES.has(searchError.replace('Error: ', ''))
? t(`toast.${searchError.replace('Error: ', '')}`, { path: skillsDirPath })
: t('marketplace.searchError')}
: searchError}
Comment on lines 30 to 32
} catch (error) {
sendJson(res, 500, { success: false, error: String(error) });
sendJson(res, 500, { success: false, error: error instanceof Error ? error.message : String(error) });
}
Comment thread src/stores/skills.ts
Comment on lines 174 to +177
const appError = normalizeAppError(error, { module: 'skills', operation: 'fetch' });
const errorKey = mapErrorCodeToSkillErrorKey(appError.code, 'fetch');
// Preserve previous skills on error (stale-while-revalidate).
set((prev) => ({ loading: false, error: mapErrorCodeToSkillErrorKey(appError.code, 'fetch'), skills: prev.skills }));
set((prev) => ({ loading: false, error: errorKey ?? appError.message, skills: prev.skills }));
@vcfgv vcfgv force-pushed the bugfix/expose-actual-skill-installation-error branch from 823dedf to 166ab82 Compare April 30, 2026 10:21
@vcfgv vcfgv merged commit e545fa2 into main Apr 30, 2026
6 checks passed
@vcfgv vcfgv deleted the bugfix/expose-actual-skill-installation-error branch April 30, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants