---
title: "Error Handling | Micdrop"
description: "Handle errors gracefully in your voice conversations with comprehensive error management and user feedback."
url: "https://micdrop.dev/docs/client/error-handling"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# Error Handling

Handle errors gracefully in your voice conversations with comprehensive error management and user feedback.

## Basic Error Handling

Listen for errors using the Error event:

```
import { Micdrop } from '@micdrop/client'
// Listen for all errorsMicdrop.on('Error', (error) => {  console.error('Error:', error.code, error.message)})
```

## State-Based Error Handling

Access error information from the state:

```
// Check for errors in stateMicdrop.on('StateChange', (state) => {  if (state.error) {    console.error('Error:', state.error.code, state.error.message)    updateErrorDisplay(state.error)  } else {    clearErrorDisplay()  }})
```

With React hook:

```
// React component examplefunction ErrorDisplay() {  const state = useMicdropState()
  if (!state.error) return null
  return (    <div className="error-banner">      <span className="error-icon">⚠️</span>      <span className="error-message">        {getUserFriendlyMessage(state.error)}      </span>      <button        className="error-action"        onClick={() => handleErrorAction(state.error)}      >        {getErrorActionLabel(state.error.code)}      </button>    </div>  )}
```

## Error Types

Micdrop provides specific error codes to help you handle different scenarios:

### Connection Errors

```
Micdrop.on('Error', (error) => {  switch (error.code) {    case 'MissingUrl':      showError('Please provide a server URL to connect to')      break
    case 'Connection':      showError(        'Failed to connect to server. Please check your internet connection.'      )      break
    case 'BadRequest':      showError('Invalid request parameters. Please check your configuration.')      break
    case 'NotFound':      showError('Voice server not found. Please check the server URL.')      break
    case 'Unauthorized':      showError('Authentication failed. Please check your credentials.')      showLoginDialog()      break
    case 'InternalServer':      showError('Server error occurred. Please try again later.')      break  }})
```

### Microphone Error

```
Micdrop.on('Error', (error) => {  if (error.code === 'Mic') {    console.error('Microphone error:', error.message)    showMicPermissionDialog()  }})
```

[Previous← Voice Activity Detection (VAD)](/docs/client/vad)[NextMic →](/docs/client/utility-classes/mic)

On this page

*   [Basic Error Handling](#basic-error-handling)
*   [State-Based Error Handling](#state-based-error-handling)
*   [Error Types](#error-types)
*   [Connection Errors](#connection-errors)
*   [Microphone Error](#microphone-error)
