---
schema_version: "1"
id: a8445ef6f9672f0f0ffcf3b0600411b7d1ccd7b5006036f82e0c799fc860e10d
title: APIkit for AsyncAPI Error Handling Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/apikit/latest/apikit-asyncapi-error-handling-reference.md
canonical_url: https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-error-handling-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 89dcc0bff0a9cd1aae0aa7fee3adc6e9f7dca9818973d6faa3860c1e1b18e307
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
---
product: APIkit
version: 4.x
is-latest-version: true
---

# APIkit for AsyncAPI Error Handling Reference

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

APIkit for AsyncAPI maps runtime failures to typed errors that cover validation, publishing,
routing, and internal faults. Use the table to diagnose which phase failed and adjust your AsyncAPI
implementation or flow configuration.

<table><colgroup><col> <col></colgroup><thead><tr><th>Error Type</th><th>Description</th></tr></thead><tbody><tr><td><p>INTERNAL_SERVER_ERROR</p></td><td><p>Internal error.</p></td></tr><tr><td><p>VALIDATION_ERROR</p></td><td><p>The payload doesn’t meet the schema of the API spec.</p></td></tr><tr><td><p>PUBLISHING_ERROR</p></td><td><p>APIkit fails to publish messages on the selected channel.</p></td></tr><tr><td><p>ROUTING_ERROR</p></td><td><p>APIkit fails to route messages to the flows.</p></td></tr></tbody></table>

## APIkit for AsyncAPI Error Handling

The APIkit for AsyncAPI scaffolder does not generate error-handling code. Add `on-error` components
and scopes in your Mule application as needed.

## Kafka Limitations

If you enable content validation, the Source Message Listener (the component that consumes messages
from Kafka topics) doesn’t throw an exception for invalid messages. Consequently, you can’t
implement the DLQ/DLT pattern for Kafka in this scenario. Instead, the consumer must route invalid
messages to DLQ/DLT topics.
