From d34739f45996045513f08df1dadfcd77fec1870b Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 8 Jul 2022 11:19:41 +0100 Subject: [PATCH] Updated query tests to remove altered datasource. Updated messaging for refresh failure messaging --- packages/server/src/api/routes/tests/query.spec.js | 1 - packages/server/src/threads/query.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/routes/tests/query.spec.js b/packages/server/src/api/routes/tests/query.spec.js index 273bdb9993..00cae3a9c9 100644 --- a/packages/server/src/api/routes/tests/query.spec.js +++ b/packages/server/src/api/routes/tests/query.spec.js @@ -218,7 +218,6 @@ describe("/queries", () => { expect(res.body.schemaFields).toEqual(["a", "b"]) expect(res.body.rows.length).toEqual(1) expect(events.query.previewed).toBeCalledTimes(1) - datasource.config = { schema: "public" } expect(events.query.previewed).toBeCalledWith(datasource, query) }) diff --git a/packages/server/src/threads/query.js b/packages/server/src/threads/query.js index 0fe331c7bb..757fdc040b 100644 --- a/packages/server/src/threads/query.js +++ b/packages/server/src/threads/query.js @@ -191,8 +191,9 @@ class QueryRunner { } else { // In this event the user may have oAuth issues that // could require re-authenticating with their provider. + let errorMessage = resp.err.data ? resp.err.data : resp.err.toString() throw new Error( - "OAuth2 access token could not be refreshed: " + resp.err.toString() + "OAuth2 access token could not be refreshed: " + errorMessage ) }