error-handling

Detect and fix floating promises, silent catches, and non-Error throws in TypeScript and JavaScript.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/gil00pita/lanify --skill error-handling-gil00pita
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/gil00pita/lanify/tree/main/.agents/skills/error-handling
Command: npx skills add https://github.com/gil00pita/lanify --skill error-handling-gil00pita

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill fixes error handling issues including floating promises, silent catches, and throwing non-Error objects. Use when encountering @typescript-eslint/no-floating-promises, silent catch blocks, or throw statement issues.

Core Features & Use Cases

  • Detect and fix floating promises by ensuring they are awaited, cast to void with catch, or assigned for later handling.
  • Detect silent or empty catch blocks and replace with proper logging, context, or rethrowing to preserve visibility.
  • Enforce throwing Error objects (or custom error classes) rather than strings or plain objects to preserve stack traces and enable robust error handling.
  • Real-world scenarios include startup sequences, API route handlers, and long-running background tasks where error visibility matters.

Quick Start

Identify the error handling issue type in your project and apply the recommended fix pattern to improve reliability.

Frequently Asked Questions about error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix floating promises in TypeScript?

Fix floating promises by awaiting them, casting to void with a catch block, or assigning them for later handling. This resolves @typescript-eslint/no-floating-promises errors by ensuring all async operations are properly tracked.

Why do empty catch blocks cause issues in JavaScript?

Empty catch blocks hide errors and reduce application visibility. Replace silent catches with proper logging, context addition, or rethrowing to preserve error details and maintain debugging visibility.

What happens when you throw non-Error values in JavaScript?

Throwing non-Error values like strings or plain objects loses stack traces and breaks error handling. Enforce throwing Error objects or custom error classes to preserve stack traces and enable robust debugging.

How do I resolve the no-floating-promises ESLint error in async code?

Resolve no-floating-promises by ensuring async operations are awaited, explicitly cast to void with a catch, or assigned. This Skill applies static analysis patterns to detect and fix unhandled promise rejections.

Does this error handling approach work for both backend and frontend JavaScript?

Yes, this applies to JavaScript and TypeScript projects across backend and frontend, covering async operations, promises, and exception handling in API route handlers and long-running background tasks.

What is the best way to handle errors in TypeScript promise chains?

Handle promise chain errors by replacing silent catches with logging or rethrowing, ensuring promises are awaited, and throwing Error objects to maintain stack traces for robust exception management.