Skip to content

Commit

Permalink
Recompile index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tylercamp committed Dec 17, 2021
1 parent d285c01 commit e446071
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = async function run() {
if (lastStatus == JobStatus.COMPLETED) {
core.info("Analysis finished! Completed with status: " + lastStatus)
} else {
throw new Error("Analysis finished with non-complete status: " + lastStatus)
throw new Error(`Analysis finished with non-complete status: ${lastStatus}. See Code Dx server logs/visual log for more details.`)
}
}
}
Expand Down Expand Up @@ -210,7 +210,13 @@ class CodeDxApiClient {
}

async testConnection() {
const response = await this.anonymousHttp.get('/x/system-info').catch(rethrowError)
const response = await this.anonymousHttp.get('/x/system-info').catch(e => {
if (axios.isAxiosError(e) && e.response) {
throw new Error(`Expected OK response, got ${e.response.status}. Is this a Code Dx instance?`)
} else {
throw e
}
})

if (typeof response.data != 'object') {
throw new Error(`Expected JSON Object response, got ${typeof response.data}. Is this a Code Dx instance?`)
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit e446071

Please sign in to comment.