Agent skill

backend-error-handling

Backend typed error handling and boundary mapping

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/backend-error-handling

Metadata

Additional technical details for this skill

stack
node-react-next
style
solid-clean-code

SKILL.md

What I do

Je standardise une gestion d'erreurs typée et composable côté backend.

Rules

  • Domain errors : invariants.
  • Application errors : orchestration/policies.
  • Presentation : mapping vers HTTP.

Template

ts
export class NotFoundError extends Error {
  readonly code = 'NOT_FOUND';
}

export function toHttp(err: unknown) {
  if (err instanceof NotFoundError) return { status: 404, body: { message: err.message } };
  return { status: 500, body: { message: 'Internal error' } };
}

When to use

  • Chaque fois qu'un contrôleur commence à contenir des if/else d'erreurs.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results