Updated query tests to remove altered datasource. Updated messaging for refresh failure messaging

This commit is contained in:
Dean 2022-07-08 11:19:41 +01:00
parent 02c0b433bb
commit d34739f459
2 changed files with 2 additions and 2 deletions

View File

@ -218,7 +218,6 @@ describe("/queries", () => {
expect(res.body.schemaFields).toEqual(["a", "b"]) expect(res.body.schemaFields).toEqual(["a", "b"])
expect(res.body.rows.length).toEqual(1) expect(res.body.rows.length).toEqual(1)
expect(events.query.previewed).toBeCalledTimes(1) expect(events.query.previewed).toBeCalledTimes(1)
datasource.config = { schema: "public" }
expect(events.query.previewed).toBeCalledWith(datasource, query) expect(events.query.previewed).toBeCalledWith(datasource, query)
}) })

View File

@ -191,8 +191,9 @@ class QueryRunner {
} else { } else {
// In this event the user may have oAuth issues that // In this event the user may have oAuth issues that
// could require re-authenticating with their provider. // could require re-authenticating with their provider.
let errorMessage = resp.err.data ? resp.err.data : resp.err.toString()
throw new Error( throw new Error(
"OAuth2 access token could not be refreshed: " + resp.err.toString() "OAuth2 access token could not be refreshed: " + errorMessage
) )
} }