Skip to content

fix: use ConvexError in skills publish mutation for client-visible errors#188

Merged
juhgiyo merged 1 commit intomainfrom
claude/use-convex-error-for-skills-publish
Apr 13, 2026
Merged

fix: use ConvexError in skills publish mutation for client-visible errors#188
juhgiyo merged 1 commit intomainfrom
claude/use-convex-error-for-skills-publish

Conversation

@juhgiyo
Copy link
Copy Markdown
Contributor

@juhgiyo juhgiyo commented Apr 11, 2026

Summary

  • Apply the same Error → ConvexError fix from PR fix: use ConvexError for client-facing publish errors #187 (roles.ts) to convex/skills.ts
  • Add throwIfDepErrors helper with actionable messages (skill slug, missing dep names, fix suggestion)
  • Convert 7 throw statements in the client-facing publish mutation from Error to ConvexError
  • publishInternal left unchanged (httpAction catches e.message)

Fixes the same Convex security behavior where plain Error messages are stripped from client-facing mutations — web UI users saw generic "Server Error" instead of the actual error text.

Test plan

  • All 266 existing tests pass
  • TypeScript compiles cleanly
  • Code review: NO_FURTHER_IMPROVEMENTS
  • Code simplifier: NO_FURTHER_IMPROVEMENTS
  • QA verification: all 9 acceptance criteria pass

🤖 Generated with Claude Code

… errors

Convex strips plain Error messages from client-facing mutations as a
security feature — only ConvexError passes through to the web UI client.
This change mirrors PR #187's fix for roles.ts:

- Add ConvexError import from convex/values
- Add throwIfDepErrors helper with actionable messages (includes skill
  slug, missing dependency names, and fix suggestions)
- Change all throw new Error() to throw new ConvexError() in the
  client-facing publish mutation (auth, ownership, deletion, version,
  dependency errors)
- Leave publishInternal and other internal mutations unchanged

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
strawhub Ready Ready Preview, Comment Apr 11, 2026 0:11am

juhgiyo added a commit that referenced this pull request Apr 12, 2026
…tations

Apply the same Error → ConvexError fix from PR #187 (roles.ts) and
PR #188 (skills.ts) to the remaining three entity files. In each
client-facing publish mutation, all throw new Error() statements are
replaced with throw new ConvexError() so error messages pass through
to the web UI instead of being stripped by Convex's security layer.

Version error messages now include the entity slug for easier debugging.
publishInternal mutations are intentionally left unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@juhgiyo juhgiyo merged commit 0d400e0 into main Apr 13, 2026
7 checks passed
@juhgiyo juhgiyo deleted the claude/use-convex-error-for-skills-publish branch April 13, 2026 22:42
juhgiyo added a commit that referenced this pull request Apr 13, 2026
#189)

## Summary
- Apply the same Error → ConvexError fix from PR #187 (roles.ts) and PR
#188 (skills.ts) to the remaining 3 files
- Convert 7 throw statements per file (21 total) in client-facing
publish mutations from Error to ConvexError
- Enhanced version error messages to include entity slug for better
debugging context
- publishInternal mutations left unchanged (httpAction catches
e.message)
- No throwIfDepErrors helper needed (these entities have no dependency
validation)

Completes the Error → ConvexError migration across all 5 publish
mutations: roles.ts (#187), skills.ts (#188), agents.ts +
integrations.ts + memories.ts (this PR).

## Test plan
- [x] All 266 existing tests pass
- [x] TypeScript compiles cleanly
- [x] Code review: NO_FURTHER_IMPROVEMENTS
- [x] Code simplifier: NO_FURTHER_IMPROVEMENTS
- [x] QA verification: all 9 acceptance criteria pass (verified
per-file)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant