Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@plasius/error

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plasius/error

Error handling functions and types for Plasius projects

latest
Source
npmnpm
Version
1.0.17
Version published
Maintainers
1
Created
Source

@plasius/error

npm version Build Status coverage License Code of Conduct Security Policy Changelog

Public package containing shared error boundary and error-handling utilities for Plasius React applications.

Install

npm install @plasius/error

Module formats

@plasius/error ships dual module outputs:

  • ESM via exports.import (dist/index.js)
  • CJS via exports.require (dist-cjs/index.js, explicitly marked CommonJS)

Usage

import { ErrorBoundary } from "@plasius/error";

Error boundary fallback translations

Default fallback text is resolved through @plasius/translations with bundled en-GB copy. Consumers can pass a translator to replace the default text while preserving the existing fallback override:

import { ErrorBoundary, errorBoundaryTranslationKeys } from "@plasius/error";

<ErrorBoundary
  name="CheckoutBoundary"
  translate={(key, args) => {
    if (key === errorBoundaryTranslationKeys.defaultFallback) {
      return `${args?.boundary} is unavailable.`;
    }

    return undefined;
  }}
>
  <CheckoutPage />
</ErrorBoundary>;

Error reporting with @plasius/analytics

ErrorBoundary can forward captured errors into an analytics-compatible client:

import { ErrorBoundary } from "@plasius/error";
import { createFrontendAnalyticsClient } from "@plasius/analytics";

const analytics = createFrontendAnalyticsClient({
  source: "sharedcomponents",
  endpoint: "https://analytics.example.com/collect",
});

<ErrorBoundary
  name="CheckoutBoundary"
  analyticsClient={analytics}
  errorContext={{ feature: "checkout" }}
>
  <CheckoutPage />
</ErrorBoundary>;

The boundary forwards a minimal report (boundary, error, component stack, severity, context), and @plasius/analytics handles sanitization and secure transport rules.

Whole application crash capture

installGlobalCrashReporter captures crashes outside React boundaries where available:

  • browser: window.error, window.unhandledrejection
  • server/runtime: process.uncaughtException, process.unhandledRejection
import {
  ErrorBoundary,
  installGlobalCrashReporter,
} from "@plasius/error";

const crashReporter = installGlobalCrashReporter({
  boundaryName: "GlobalApplication",
  analyticsClient: analytics,
  errorContext: { app: "frontend" },
});

// later during teardown
crashReporter.dispose();

Development

npm ci
npm run typecheck
npm run build
npm test

Governance

License

MIT

FAQs

Package last updated on 01 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts