/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/media-utils/src/utils/upload-error.ts
26 строк
495 B
Pascal Birchler
Media Utils: Add TypeScript support and export more utils (#64784)
05 сен 2024, 17:01
Не верифицирован
05 сен 2024, 17:01
f4cad96
Код
Авторство
О чём код?
interface UploadErrorArgs { code: string; message: string; file: File; cause?: Error; } /** * MediaError class. * * Small wrapper around the `Error` class * to hold an error code and a reference to a file object. */ export class UploadError extends Error { code: string; file: File; constructor( { code, message, file, cause }: UploadErrorArgs ) { super( message, { cause } ); Object.setPrototypeOf( this, new.target.prototype ); this.code = code; this.file = file; } }