The error that occurred (can be any type)
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 })
}
})
Callback function type for handling errors.
Used for error callbacks in ConsumerCreationParams to handle publish failures and database errors.