Skip to content

Commit

Permalink
fixup! remove err.handled
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos committed Mar 19, 2024
1 parent 0a48986 commit db3b2ae
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default class Spark {
console.log(`Found peer id: ${peerId}`)
stats.providerId = peerId
} catch (err) {
console.error(err)
// There are three common error cases:
// 1. We are offline
// 2. The JSON RPC provider is down
Expand All @@ -61,12 +60,9 @@ export default class Spark {
// The third case should not happen unless we made a mistake, so we want to learn about it
if (err.name === 'FilecoinRpcError') {
// TODO: report the error to Sentry
console.error('The error printed above was not expected, please report it on GitHub:')
console.error('The error printed below was not expected, please report it on GitHub:')
console.error('https://github.com/filecoin-station/spark/issues/new')
} else {
this.#activity.onError()
}
err.reported = true
// Abort the check, no measurement should be recorded
throw err
}
Expand All @@ -76,7 +72,7 @@ export default class Spark {
stats.indexerResult = indexerResult

const providerFound = indexerResult === 'OK' || indexerResult === 'HTTP_NOT_ADVERTISED'
if (!providerFound) return
if (!providerFound) return stats

stats.protocol = provider.protocol
stats.providerAddress = provider.address
Expand Down Expand Up @@ -234,8 +230,6 @@ export default class Spark {
}

handleRunError (err) {
if (err.reported) return

if (err.statusCode === 400 && err.serverMessage === 'OUTDATED CLIENT') {
this.#activity.onOutdatedClient()
} else {
Expand Down

0 comments on commit db3b2ae

Please sign in to comment.