From 6797a8a9fc34badcaba84216b261b6f0b1575813 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Fri, 3 Jan 2020 12:02:22 +0100 Subject: [PATCH] chore(@embark/proxy): suppress error logs when inside test-runner context When running tests that expect the EVM to fail, Embark's proxy keeps logging the VM errors to stdout making it look like tests weren't successful, while they are actually passing. Inside a test-runner it's probably expected not to see any error logs when the tests in question expect errors. This commit changes the proxy to use `debug()` logs instead of `error()`, making it configurable through log verbosity how much errors are seen. --- packages/stack/proxy/src/index.ts | 4 ++-- packages/stack/proxy/src/proxy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stack/proxy/src/index.ts b/packages/stack/proxy/src/index.ts index 44591a58d..8962b1db6 100644 --- a/packages/stack/proxy/src/index.ts +++ b/packages/stack/proxy/src/index.ts @@ -128,7 +128,7 @@ export default class ProxyManager { isWs: false, logger: this.logger, plugins: this.plugins, - isVm: this.isVm + isVm: this.isVm, }) .serve( this.host, @@ -143,7 +143,7 @@ export default class ProxyManager { isWs: true, logger: this.logger, plugins: this.plugins, - isVm: this.isVm + isVm: this.isVm, }) .serve( this.host, diff --git a/packages/stack/proxy/src/proxy.js b/packages/stack/proxy/src/proxy.js index 5ded605d4..dd57a457f 100644 --- a/packages/stack/proxy/src/proxy.js +++ b/packages/stack/proxy/src/proxy.js @@ -152,7 +152,7 @@ export class Proxy { if (modifiedResp && modifiedResp.response && modifiedResp.response.error) { // error returned from the node and it wasn't stripped by our response actions const error = modifiedResp.response.error.message || modifiedResp.response.error; - this.logger.error(__(`Error returned from the node: ${error}`)); + this.logger.debug(__(`Error returned from the node: ${error}`)); const rpcErrorObj = { "jsonrpc": "2.0", "error": { "code": -32603, "message": error }, "id": modifiedResp.response.id }; return this.respondError(transport, rpcErrorObj); }