Skip to content
error-monitoring-specialist logo

Error Monitoring Specialist

error-monitoring-specialist

Expert in error handling, Error Boundaries, Sentry integration, logging strategies, error recovery, user-friendly error UI, and debugging tools

SKILL.md

Full skill instructions

Error Monitoring Specialist

Expert skill for comprehensive error handling and monitoring. Specializes in Error Boundaries, Sentry, logging, error recovery, and user-friendly error experiences.

Core Capabilities

1. Error Boundaries

  • Class Components: componentDidCatch
  • React Error Boundaries: Catch rendering errors
  • Fallback UI: User-friendly error pages
  • Error Recovery: Reset component state
  • Nested Boundaries: Granular error handling

2. Error Tracking

  • Sentry: Industry-standard error tracking
  • LogRocket: Session replay
  • Bugsnag: Error monitoring
  • Custom Logging: Application-specific logs
  • Source Maps: Map errors to source code

3. Error Types

  • Runtime Errors: JavaScript errors
  • Network Errors: Failed API calls
  • Validation Errors: Form validation
  • 404 Errors: Not found pages
  • Permission Errors: Unauthorized access
  • Async Errors: Promise rejections

4. User Experience

  • Friendly Messages: Non-technical language
  • Retry Mechanisms: Allow users to retry
  • Contact Support: Easy reporting
  • Fallback Content: Graceful degradation
  • Error Analytics: Track common errors

Error Boundary

// ErrorBoundary.tsx
import { Component, ReactNode, ErrorInfo } from 'react'
import * as Sentry from '@sentry/​react'

interface Props {
  children: ReactNode
  fallback?: ReactNode
}

interface State {
  hasError: boolean
  error: Error | null
}

export class ErrorBoundary extends Component<Props, State> {
  constructor(props: Props) {
    super(props)
    this.state = { hasError: false, error: null }
  }

  static getDerivedStateFromError(error: Error): State {
    return { hasError: true, error }
  }

  componentDidCatch(error: Error, errorInfo: ErrorInfo) {
    console.error('Error caught by boundary:', error, errorInfo)
    Sentry.captureException(error, { contexts: { react: { componentStack: errorInfo.componentStack } } })
  }

  render() {
    if (this.state.hasError) {
      return this.props.fallback || (
        <div className="error-fallback">
          <h1>Something went wrong</​h1>
          <p>We've been notified and are working on a fix.</​p>
          <button onClick={() => this.setState({ hasError: false, error: null })}>
            Try again
          </​button>
        </​div>
      )
    }

    return this.props.children
  }
}

Sentry Setup

// sentry.ts
import * as Sentry from '@sentry/​react'
import { BrowserTracing } from '@sentry/​tracing'

Sentry.init({
  dsn: process.env.REACT_APP_SENTRY_DSN,
  integrations: [new BrowserTracing()],
  tracesSampleRate: 1.0,
  environment: process.env.NODE_ENV,
  beforeSend(event, hint) {
    if (event.exception) {
      console.error(hint.originalException || hint.syntheticException)
    }
    return event
  },
})

// Usage
try {
  throw new Error('Test error')
} catch (error) {
  Sentry.captureException(error)
}

Async Error Handling

// hooks/​useAsyncError.ts
import { useState } from 'react'

export function useAsyncError() {
  const [, setError] = useState()

  return (error: Error) => {
    setError(() => {
      throw error
    })
  }
}

// Usage
function AsyncComponent() {
  const throwError = useAsyncError()

  useEffect(() => {
    fetchData().catch(throwError)
  }, [])
}

API Error Handling

// api/​errorHandler.ts
export class APIError extends Error {
  constructor(public status: number, message: string) {
    super(message)
    this.name = 'APIError'
  }
}

export async function handleAPIError(response: Response) {
  if (!response.ok) {
    const error = await response.json()
    throw new APIError(response.status, error.message)
  }
  return response
}

// Usage
fetch('/​api/​data')
  .then(handleAPIError)
  .then(response => response.json())
  .catch(error => {
    if (error instanceof APIError) {
      if (error.status === 401) {
        // Redirect to login
      }
    }
    Sentry.captureException(error)
  })

Best Practices

  • Use Error Boundaries at route level
  • Log errors to monitoring service
  • Show user-friendly error messages
  • Provide retry mechanisms
  • Track error frequency
  • Monitor error trends
  • Test error scenarios
  • Document common errors

When to Use This Skill

Use when you need to:

  • Set up error monitoring
  • Create Error Boundaries
  • Integrate Sentry or LogRocket
  • Handle API errors gracefully
  • Build error recovery mechanisms
  • Improve error UX
  • Debug production errors

Output Format

Provide:

  1. Error Boundaries: Component-level error handling
  2. Monitoring Setup: Sentry/​LogRocket configuration
  3. Error UI: User-friendly error pages
  4. Logging Strategy: What and how to log
  5. Recovery Mechanisms: How users can recover
  6. Testing: Error scenario tests

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View