export function ConnectExceptionHandler() { return function(target: any, propertyKey: string, descriptor: PropertyDescriptor) { const originalMethod = descriptor.value descriptor.value = async function(...args: any[]): Promise { try { const result = originalMethod.apply(this, args) if (result instanceof Promise) { return await result } return result } catch (e) { if (typeof args[2] === 'function') { args[2](e) } } } } }