Skip to content

Fix unhandled ResultSet.json errors, prepare 1.6.0#311

Merged
slvrtrn merged 2 commits intomainfrom
fix-unhandled-result-set-errors
Sep 12, 2024
Merged

Fix unhandled ResultSet.json errors, prepare 1.6.0#311
slvrtrn merged 2 commits intomainfrom
fix-unhandled-result-set-errors

Conversation

@slvrtrn
Copy link
Contributor

@slvrtrn slvrtrn commented Sep 12, 2024

Summary

Resolves #309

Checklist

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@slvrtrn slvrtrn changed the title Fix unhandled ResultSet.json errors Fix unhandled ResultSet.json errors, prepare 1.6.0 Sep 12, 2024
@slvrtrn slvrtrn requested a review from mshustov September 12, 2024 17:43
@sonarqubecloud
Copy link

}
})
stream.on('end', resolve)
stream.on('error', reject)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed?

Copy link
Contributor Author

@slvrtrn slvrtrn Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exact part that produced unhandled exceptions.

for await (const rows of stream) {
  for (const row of rows) {
    result.push(row.json())
  }
}

achieves the same on the modern Node.js versions, but we can catch the error properly on the app side.

@slvrtrn slvrtrn merged commit fa85613 into main Sep 12, 2024
@slvrtrn slvrtrn deleted the fix-unhandled-result-set-errors branch September 12, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncatchable parse errors when incoming data is not a valid JSON

2 participants