useBatchErrorListener
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/uploady
yarn add @rpldy/uploady
pnpm add @rpldy/uploady
Detailsβ
type useBatchErrorListener = BatchEventHook;
- See: BatchEventHook
- See: Batch Entity
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}`);
});
//...
};