Class: SerializationError

KafkaJS.SerializationError(e, code)

EXPERIMENTAL: subject to change or removal.

SerializationError is the common base of KafkaJS.KeySerializationError and KafkaJS.ValueSerializationError, so that either can be recognised with a single check.

Either is thrown by KafkaJS.Producer#send when the serializer configured through js.key.serializer.builder or js.value.serializer.builder throws. The error thrown by the serializer is kept as KafkaJS.SerializationError#cause.

Constructor

new SerializationError(e, code)

This constructor is meant to be used by the library. Use KafkaJS.KeySerializationError or KafkaJS.ValueSerializationError instead.

Parameters:
Name Type Description
e Error | string

the error thrown by the serializer.

code number

the error code, set by the subclass.

Extends

Members

abortable :boolean

Whether the error is abortable (for transactional producer).

Type:
  • boolean
Overrides:

cause :Error|null

The error thrown by the serializer, or null if it threw a non-Error.

Type:
  • Error | null

code :number

The error code from Librdkafka.

This field should be checked (as opposed to the type of the error) to determine what sort of an error this is.

Type:
  • number
Overrides:
See:

fatal :boolean

Whether the error is fatal (for transactional producer).

Type:
  • boolean
Overrides:

message :string

Message detailing the error.

Type:
  • string
Overrides:

name :string

Name of the error.

Type:
  • string
Overrides:

retriable :boolean

Whether the error is retriable (for transactional producer).

Type:
  • boolean
Overrides:

stack

The stack trace of the error.

Overrides: