Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleError(
exceptionsHandler: RpcExceptionsHandler,
args: any[],
error: T,
): Observable {
const host = new ExecutionContextHost(args);
host.setType('rpc');
return exceptionsHandler.handle(error, host);
}
return (done: jest.DoneCallback) => {
const toAbsoluteUrl = jest.fn().mockReturnValue('visited');
const configService = new MockConfigService();
configService.assetOptions.assetStorageStrategy = { toAbsoluteUrl };
const interceptor = new AssetInterceptor(configService as any);
const executionContext = new ExecutionContextHost([0, 0, { req: {} }]);
const next: CallHandler = { handle: () => of(response) };
interceptor.intercept(executionContext, next).subscribe(result => {
assertFn(response, result, toAbsoluteUrl);
done();
});
};
}
handleError(
exceptionsHandler: WsExceptionsHandler,
args: any[],
error: T,
) {
const host = new ExecutionContextHost(args);
host.setType('ws');
exceptionsHandler.handle(error, host);
}
defaultCallMetadata,
);
return proxy(...args);
} catch (err) {
let exceptionFilter = this.exceptionFiltersCache.get(
instance[methodKey],
);
if (!exceptionFilter) {
exceptionFilter = this.exceptionFiltersContext.create(
instance,
instance[methodKey],
moduleKey,
);
this.exceptionFiltersCache.set(instance[methodKey], exceptionFilter);
}
const host = new ExecutionContextHost(args);
host.setType('rpc');
exceptionFilter.handle(err, host);
}
};
}