mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
分离工具函数
This commit is contained in:
1 parent
7a84c262da
commit
8ef582f714
22 files changed
+724
-687
No files matched your search
@@ -0,0 +1,16 @@
|
||||
export class ArtPlayerError extends Error {
|
||||
constructor(message, context) {
|
||||
super(message);
|
||||
if (typeof Error.captureStackTrace === 'function') {
|
||||
Error.captureStackTrace(this, context || this.constructor);
|
||||
}
|
||||
this.name = 'ArtPlayerError';
|
||||
}
|
||||
}
|
||||
|
||||
export function errorHandle(condition, msg) {
|
||||
if (!condition) {
|
||||
throw new ArtPlayerError(msg);
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
Reference in new issue
Block a user