Skip to main content

hasBeenAborted()

Pass an error to the hasBeenAborted() function to check if the error was thrown because you opted to abort the render.
In this case, the error is intentional and you probably don't want to display it.

Check if a media file download has been aborted.

Check if a download has been aborted
tsx
import {parseMedia, hasBeenAborted} from '@remotion/media-parser';
 
try {
await parseMedia({
src: 'https://www.w3schools.com/html/mov_bbb.mp4',
});
} catch (e) {
if (hasBeenAborted(e)) {
console.log('Has been aborted by user / developer');
} else {
console.error('Download failed', e);
}
}

See also