Handling Failures
Sometimes, endpoints fail due to various reasons such as network issues or server issues.
In such cases, QStash offers a few options to handle these failures.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST \
https://qstash.upstash.io/v2/publish/<DESTINATION_URL> \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <QSTASH_TOKEN>' \
-H 'Upstash-Failure-Callback: <CALLBACK_URL>' \
-d '{ "hello": "world" }'
import { Client } from "@upstash/qstash";
const client = new Client({ token: "<QSTASH_TOKEN>" });
const res = await client.publishJSON({
url: "https://my-api...",
body: { hello: "world" },
failureCallback: "https://my-callback...",
});
from qstash import QStash
client = QStash("<QSTASH_TOKEN>")
client.message.publish_json(
url="https://my-api...",
body={
"hello": "world",
},
failure_callback="https://my-callback...",
)
Was this page helpful?