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"); }