unierror.uts 1014 字节
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
import { CreateInnerAudioContextErrorCode, ICreateInnerAudioContextFail } from "./interface.uts"

/**
 * 错误主题
 */

export const CreateInnerAudioUniErrorSubject = 'uni-createInnerAudioContext';

/**
 * 错误码
 * @UniError
 */
export const CreateInnerAudioContextUniErrors : Map<CreateInnerAudioContextErrorCode, string> = new Map([
	/**
	 * 系统错误
	 */
	[1107601, 'system error.'],
	/**
	 * 网络错误
	 */
	[1107602, 'network error.'],
	/**
	 * 文件错误
	 */
	[1107603, 'file error.'],
	/**
	 * 格式错误
	 */
	[1107604, 'format error.'],
	/**
	 * 未知错误
	 */
	[1107605, 'unknown error.'],
	/**
	 * 播放路径不能为空
	 */
	[1107609, 'empty src.'],
]);

export class CreateInnerAudioContextFailImpl extends UniError implements ICreateInnerAudioContextFail {
	constructor(errCode : CreateInnerAudioContextErrorCode) {
		super();
		this.errSubject = CreateInnerAudioUniErrorSubject;
		this.errCode = errCode;
		this.errMsg = CreateInnerAudioContextUniErrors[errCode] ?? "";
	}
}