From e918cc150a324f38ca15718c2968849a480df4ff Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Thu, 22 May 2025 08:35:22 -0700 Subject: [PATCH] lost my logging in code review, lets go agane --- package-lock.json | 4 ++-- package.json | 2 +- templates/api-index.js.hbs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08ebe7b..7c16eb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.14", + "version": "0.23.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.13", + "version": "0.23.15", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 4dbd91e..057acaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.14", + "version": "0.23.15", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js.hbs b/templates/api-index.js.hbs index 52d270f..f144f89 100644 --- a/templates/api-index.js.hbs +++ b/templates/api-index.js.hbs @@ -75,7 +75,11 @@ module.exports = (clientID, polyCustom) => merge( ).then(({ headers, data }) => { polyHeaders = headers; if (data && (data.status < 200 || data.status >= 300)) { - console.error('Error getting direct execution data for api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', data.data); + let responseData = data.data; + try { + responseData = JSON.stringify(data.data); + } catch (err) {} + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']);