fix: make callModule a wrapper function that calls handleError
This commit is contained in:
parent
6f036eae12
commit
73ea9ca5b0
|
@ -39,7 +39,12 @@ export abstract class Client extends Emittery {
|
||||||
|
|
||||||
public getBound(module: string): ModuleBagBound {
|
public getBound(module: string): ModuleBagBound {
|
||||||
return {
|
return {
|
||||||
callModule: callModule.bind(undefined, module),
|
callModule: async (...args: any) => {
|
||||||
|
const ret = await this.callModule(module, ...args);
|
||||||
|
this.handleError(ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
connectModule: connectModule.bind(undefined, module),
|
connectModule: connectModule.bind(undefined, module),
|
||||||
} as ModuleBagBound;
|
} as ModuleBagBound;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue