Files
ArtPlayer/packages/artplayer-plugin-flv/src/flv/utils.js
T
2018-12-14 16:32:25 +08:00

15 lines
390 B
JavaScript

export class FlvError extends Error {
constructor(message, context) {
super(message);
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, context || this.constructor);
}
this.name = 'FlvError';
}
}
export function errorHandle(condition, msg) {
if (!condition) {
throw new FlvError(msg);
}
}