Skip to content

Comments

BRNGG-36274-Add integration tests for parse error handling#105

Merged
ormelaver-cyber merged 6 commits intomasterfrom
add-integration-tests-for-parsing-errors
Feb 15, 2026
Merged

BRNGG-36274-Add integration tests for parse error handling#105
ormelaver-cyber merged 6 commits intomasterfrom
add-integration-tests-for-parsing-errors

Conversation

@ormelaver-cyber
Copy link
Contributor

@ormelaver-cyber ormelaver-cyber commented Jan 29, 2026

Important Note

After further discussion, it was decided that we REMOVE the throw error when we get a SyntaxError. This was a bug that we initially decided to leave as is.
Apparently amqplib, which is the one that eventually calls consumeFunc (via channel.consume(queue, consumeFunc, { noAck: false })), does not await so there is no option to catch the error that we throw.
Now if clients want to handle the error, they must register to the afterProcessMessage callback that is invoked in _rejectMessageAfterProcess

Add integration tests for consumer parse error handling

  • Test callback is not invoked when JSON parsing fails
  • Test afterProcessMessage hook receives SyntaxError
  • Test messages are rejected without requeue (verified via messageCount)
  • Test valid messages continue processing after parse errors
  • Test empty string with JSON content type as edge case
  • Test RPC returns SyntaxError to producer on invalid request

@ormelaver-cyber ormelaver-cyber changed the title Add integration tests for parse error handling BRNGG-36274-Add integration tests for parse error handling Feb 5, 2026
@shamil shamil removed their assignment Feb 10, 2026
@ormelaver-cyber ormelaver-cyber merged commit 579a331 into master Feb 15, 2026
4 checks passed
@ormelaver-cyber ormelaver-cyber deleted the add-integration-tests-for-parsing-errors branch February 15, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants