axios-miniprogram/src/helpers/error.ts

10 lines
206 B
TypeScript
Raw Normal View History

2023-03-28 21:32:54 +08:00
export function assert(condition: boolean, msg: string) {
if (!condition) {
throwError(msg);
}
}
export function throwError(msg: string): void {
throw new Error(`[axios-miniprogram]: ${msg}`);
}