Skip to main content

useBatchErrorListener

Package​

@rpldy/uploady

Installation​

npm install @rpldy/uploady

Details​

type useBatchErrorListener = BatchEventHook;
note

Event Hook - BATCH-ERROR

Called in case batch failed with an error. These errors will most likely occur due to invalid event handling. For instance, by a handler (ex: BATCH_START) throwing an error.

info

This event can be scoped to a specific batch by passing the batch id as a second parameter

Example​

import { useBatchErrorListener } from "@rpldy/uploady";

const MyComponent = () => {
useBatchErrorListener((batch) => {
console.log(`batch ${batch.id} had an error: ${batch.additionalInfo}`);
});

//...
};