We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57e39c7 commit d285c01Copy full SHA for d285c01
1 file changed
codedx.js
@@ -62,7 +62,13 @@ class CodeDxApiClient {
62
}
63
64
async testConnection() {
65
- const response = await this.anonymousHttp.get('/x/system-info').catch(rethrowError)
+ const response = await this.anonymousHttp.get('/x/system-info').catch(e => {
66
+ if (axios.isAxiosError(e) && e.response) {
67
+ throw new Error(`Expected OK response, got ${e.response.status}. Is this a Code Dx instance?`)
68
+ } else {
69
+ throw e
70
+ }
71
+ })
72
73
if (typeof response.data != 'object') {
74
throw new Error(`Expected JSON Object response, got ${typeof response.data}. Is this a Code Dx instance?`)
0 commit comments