From c53d32b72c8c8b882e0812c9c1720cf39036fe54 Mon Sep 17 00:00:00 2001 From: Michael Vlasov Date: Mon, 25 Oct 2021 17:21:33 +0500 Subject: [PATCH] FIX: subscriptions for companion fields (*_name, *_string) didn't work --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/server/logs.ts | 9 ++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c269e2d..bbbbe25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.44.3] - 2021-10-25 + +### Fix + +- q-server didn't write error messages to log + ## [0.44.2] - 2021-10-22 ### Fix diff --git a/package.json b/package.json index cbc7208..99d52f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ton-q-server", - "version": "0.44.2", + "version": "0.44.3", "description": "TON Q Server – realtime queries over TON blockchain.", "main": "index.js", "repository": "git@github.com:tonlabs/ton-q-server.git", diff --git a/src/server/logs.ts b/src/server/logs.ts index 2dab3fc..99a9ba3 100644 --- a/src/server/logs.ts +++ b/src/server/logs.ts @@ -23,7 +23,14 @@ export interface QLog { } function str(arg: unknown): string { - const s = typeof arg === "string" ? arg : toJSON(arg); + let s; + if (arg instanceof Error) { + s = arg.message || arg.toString(); + } else if (typeof arg === "string") { + s = arg; + } else { + s = toJSON(arg); + } return s.split("\n").join("\\n").split("\t").join("\\t"); }