Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badly formatted error message for unregistered topic #118

Open
absolutejam opened this issue Sep 24, 2019 · 1 comment
Open

Badly formatted error message for unregistered topic #118

absolutejam opened this issue Sep 24, 2019 · 1 comment

Comments

@absolutejam
Copy link

Describe the bug
When trying to send an event to a topic that has not been registered with EventBus.register_topic/1, you get an error like the following:

[warn] Topic(:foo doesn't exist!) doesn't have subscribers

This should be clarified to show either the topic doesn't exist, or it doesn't have subscribers, and not display registration_status within the braces. Additionally, it should print the topic exactly as the user has passed, instead of coercing it to look like an atom, as the log message is confusing if the user has passed a string topic instead of an atom.

Below is the offending line:

"Topic(:#{topic}#{registration_status(topic)}) doesn't have subscribers"

To Reproduce

Send an %EventBus.Model.Event{} to a non-registered topic and observe the warn log entry.

Expected behavior

As per above.


I can submit a PR if you'd like, I just wanted to report and run my suggestions by you before starting.

@mustafaturan
Copy link
Member

@absolutejam

Thanks for reporting the issue. I agree on on brackets but for the topic type, if any other type is given the type checker would block it. So, expectation is from the library user to use a type checker. Feel free to create a PR to remove ambiguity inside brackets. Please make sure that tests are covered.

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

No branches or pull requests

2 participants