import { FileSystemManagerErrorCode,IFileSystemManagerFail } from "./interface.uts" /** * 错误主题 */ export const FileSystemManagerUniErrorSubject = 'uni-fileSystemManager'; /** * 错误码 * @UniError */ export const FileSystemManagerUniErrors : Map<FileSystemManagerErrorCode, string> = new Map([ [1200002, 'type error. only support base64 / utf-8'], [1300002, 'no such file or directory'], [1300013, 'permission denied'], [1300021, 'Is a directory'], [1300022, 'Invalid argument'], [1300066, 'directory not empty'], [1301003, 'illegal operation on a directory'], [1301005, 'file already exists'], [1300201, 'system error'], [1300202, 'the maximum size of the file storage limit is exceeded'], [1301111, 'brotli decompress fail'], [1302003, 'invalid flag'], [1300009, 'bad file descriptor'] ]); export class FileSystemManagerFailImpl extends UniError implements IFileSystemManagerFail { constructor(errCode : FileSystemManagerErrorCode) { super(); this.errSubject = FileSystemManagerUniErrorSubject; this.errCode = errCode; this.errMsg = FileSystemManagerUniErrors.get(errCode) ?? ""; } }