Introduction

Enhanced error handling with stacktrace parsing, code frames, and AI-powered solutions for Node.js applications.

Last updated:

@visulima/error

Comprehensive error handling library with enhanced error objects, stacktrace parsing, code frame generation, and AI-powered solution suggestions.

Key Features

Enhanced Errors

  • Custom error classes with hints and causes
  • Nested error support with full cause chains
  • Additional context and metadata

Code Frames

  • Beautiful code frame generation
  • Syntax highlighting for error locations
  • Configurable line ranges

Stacktrace Parsing

  • Parse and analyze stack traces
  • Extract file locations and line numbers
  • Cross-platform support

AI Solutions (Optional)

  • AI-powered error solutions
  • Context-aware suggestions
  • Integrates with AI providers

Quick Start

import { VisulimaError } from "@visulima/error";

class ValidationError extends VisulimaError {
    constructor(message: string) {
        super({
            name: "ValidationError",
            message,
        });
    }
}

const error = new ValidationError("Invalid email format");
error.hint = "Expected format: user@example.com";

throw error;

Use Cases

Application Error Handling: Enhanced errors for better debugging API Development: Structured error responses CLI Tools: User-friendly error messages with code frames Development Tools: Error analysis and reporting

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues