Updated query tests to remove altered datasource. Updated messaging for refresh failure messaging
This commit is contained in:
parent
02c0b433bb
commit
d34739f459
|
@ -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)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue