From d532a7072be8ee7be0019438e19e44bc78bc12d8 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Wed, 13 Mar 2024 12:46:11 +0000 Subject: [PATCH] Bug/investigate startup issue logging (#192) * Add additional logging on startup error * 2.10.10 * increase test timeout * Increase logging in testing * Revert "Increase logging in testing" This reverts commit 727a963f2368a8e828cd8dfd0daac141c59c70e3. --- app/keyWatcher/api.js | 6 +++++- package-lock.json | 4 ++-- package.json | 2 +- test/mocharc.cjs | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/keyWatcher/api.js b/app/keyWatcher/api.js index 1a9f56d..493e9b5 100644 --- a/app/keyWatcher/api.js +++ b/app/keyWatcher/api.js @@ -1,12 +1,16 @@ import { ApiPromise, WsProvider, Keyring } from '@polkadot/api' +import logger from '../logger.js' import env from '../env.js' export const createNodeApi = async () => { const provider = new WsProvider(`ws://${env.NODE_HOST}:${env.NODE_PORT}`) const api = new ApiPromise({ provider }) - await api.isReadyOrError.catch(() => {}) // prevent unhandled promise rejection errors + await api.isReadyOrError.catch((e) => { + logger.error('Error thrown initialising API, message: %s', e?.message) + logger.debug('Error thrown initialising API, stack: %j', e?.stack) + }) // prevent unhandled promise rejection errors return { _api: api, diff --git a/package-lock.json b/package-lock.json index e0803c4..c2e51d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@digicatapult/sqnc-ipfs", - "version": "2.10.9", + "version": "2.10.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@digicatapult/sqnc-ipfs", - "version": "2.10.9", + "version": "2.10.10", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "^10.12.1", diff --git a/package.json b/package.json index ceb541d..9e1197c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@digicatapult/sqnc-ipfs", - "version": "2.10.9", + "version": "2.10.10", "description": "IPFS node for use in SQNC", "main": "app/index.js", "type": "module", diff --git a/test/mocharc.cjs b/test/mocharc.cjs index d73b998..a9788a7 100644 --- a/test/mocharc.cjs +++ b/test/mocharc.cjs @@ -1,7 +1,7 @@ module.exports = { recursive: true, slow: 10000, - timeout: 20000, + timeout: 30000, extension: ['.test.js'], require: ['./test/integration/fixtures.js'], exit: true,