{
  "version": 3,
  "sources": ["../src/upload-error.ts"],
  "sourcesContent": ["/**\n * Error codes for upload operations.\n *\n * These codes categorize the different types of failures that can occur\n * during the upload process, enabling user-friendly error messages.\n */\nexport enum ErrorCode {\n\t// Validation errors\n\tEMPTY_FILE = 'EMPTY_FILE',\n\tSIZE_ABOVE_LIMIT = 'SIZE_ABOVE_LIMIT',\n\tMIME_TYPE_NOT_SUPPORTED = 'MIME_TYPE_NOT_SUPPORTED',\n\tMIME_TYPE_NOT_ALLOWED_FOR_USER = 'MIME_TYPE_NOT_ALLOWED_FOR_USER',\n\n\t// Processing errors (the same file will fail again)\n\tHEIC_DECODE_ERROR = 'HEIC_DECODE_ERROR',\n\tIMAGE_TRANSCODING_ERROR = 'IMAGE_TRANSCODING_ERROR',\n\tIMAGE_ROTATION_ERROR = 'IMAGE_ROTATION_ERROR',\n\tMEDIA_TRANSCODING_ERROR = 'MEDIA_TRANSCODING_ERROR',\n\tGIF_TRANSCODING_ERROR = 'GIF_TRANSCODING_ERROR',\n\n\t// Generic fallback\n\tGENERAL = 'GENERAL',\n}\n\ninterface UploadErrorArgs {\n\tcode: ErrorCode | string;\n\tmessage: string;\n\tfile: File;\n\tcause?: Error;\n}\n\n/**\n * MediaError class.\n *\n * Small wrapper around the `Error` class\n * to hold an error code and a reference to a file object.\n */\nexport class UploadError extends Error {\n\tcode: ErrorCode | string;\n\tfile: File;\n\n\tconstructor( { code, message, file, cause }: UploadErrorArgs ) {\n\t\tsuper( message, { cause } );\n\n\t\tObject.setPrototypeOf( this, new.target.prototype );\n\n\t\tthis.code = code;\n\t\tthis.file = file;\n\t}\n}\n"],
  "mappings": ";AAMO,IAAK,YAAL,kBAAKA,eAAL;AAEN,EAAAA,WAAA,gBAAa;AACb,EAAAA,WAAA,sBAAmB;AACnB,EAAAA,WAAA,6BAA0B;AAC1B,EAAAA,WAAA,oCAAiC;AAGjC,EAAAA,WAAA,uBAAoB;AACpB,EAAAA,WAAA,6BAA0B;AAC1B,EAAAA,WAAA,0BAAuB;AACvB,EAAAA,WAAA,6BAA0B;AAC1B,EAAAA,WAAA,2BAAwB;AAGxB,EAAAA,WAAA,aAAU;AAfC,SAAAA;AAAA,GAAA;AA+BL,IAAM,cAAN,cAA0B,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EAEA,YAAa,EAAE,MAAM,SAAS,MAAM,MAAM,GAAqB;AAC9D,UAAO,SAAS,EAAE,MAAM,CAAE;AAE1B,WAAO,eAAgB,MAAM,WAAW,SAAU;AAElD,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACb;AACD;",
  "names": ["ErrorCode"]
}
