Hermes MongoDB
    Preparing search index...

    Type Alias ErrorCallback

    ErrorCallback: (error: unknown) => void

    Callback function type for handling errors.

    Used for error callbacks in ConsumerCreationParams to handle publish failures and database errors.

    Type Declaration

      • (error: unknown): void
      • Parameters

        • error: unknown

          The error that occurred (can be any type)

        Returns void

    Logging errors

    const outbox = createOutboxConsumer({
    // ...
    onFailedPublish: (error) => {
    console.error('Failed to publish event:', error)
    // Alert monitoring system
    monitoring.alert('outbox_publish_failed', { error })
    },
    onDbError: (error) => {
    console.error('Database error:', error)
    // Alert critical error
    monitoring.alert('outbox_db_error', { error })
    }
    })