Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Handle redeclaration errors from the broker #143

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

mkorszun
Copy link
Collaborator

RabbitMQ will return an error, whenever clients try to redeclare an
existing resource with different parameters, for example:

  • an existing exchange with different type

Currently, terminate callbacks are not matching this specific error message,
so publishers and consumers will crash with: FunctionClauseError.
This makes it hard to understand what exactly has happened:
https://github.com/meltwater/gen_rmq/issues/142

With these changes:

  • terminate callbacks will be called
  • corresponding error will be logged

Description

Checklist

  • I have added unit tests to cover my changes.
  • I have improved the code quality of this repo. (refactoring, or reduced number of static analyser issues)
  • I have updated the documentation accordingly

RabbitMQ will return an error, whenever clients try to redeclare an
existing resource with different parameters, for example:
* an existing exchange with different type

Currently, terminate callbacks are not matching this specific error message,
so publishers and consumers will crash with: `FunctionClauseError`.
This makes it hard to understand what exactly has happened:
https://github.com/meltwater/gen_rmq/issues/142

With these changes:
* terminate callbacks will be called
* corresponding error will be logged
@mkorszun mkorszun requested a review from vorce as a code owner February 20, 2020 13:24
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 89.113% when pulling 0ffd173 on improve-redeclaration-error-handling into 156a466 on master.

@retf
Copy link

retf commented Feb 20, 2020

nice, tks!

Copy link
Collaborator

@vorce vorce left a comment

Choose a reason for hiding this comment

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

Great!

@mkorszun mkorszun merged commit 0610d99 into master Feb 24, 2020
@mkorszun mkorszun deleted the improve-redeclaration-error-handling branch February 24, 2020 06:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants