Skip to content

Commit

Permalink
Merge branch 'fix-500-errors' into 'master'
Browse files Browse the repository at this point in the history
Add Support For Drone Error

See merge request hive/dhive!42
  • Loading branch information
feruzm committed Oct 30, 2024
2 parents 7f0c879 + 0b0868e commit cf73ee5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export async function retryingFetch(
}
const response = await fetch(currentAddress, opts)
if (!response.ok) {
if (response.status === 500){ // Support for Drone
const resJson = await response.json();
if (resJson.jsonrpc === "2.0"){
return { response: resJson, currentAddress }
}
}
throw new Error(`HTTP ${response.status}: ${response.statusText}`)
}
return { response: await response.json(), currentAddress }
Expand Down

0 comments on commit cf73ee5

Please sign in to comment.