question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My coding error in a function doesn't indicate it's a coding error

See original GitHub issue

I’m opening this issue in the hopes of helping future novices. mqttwarn 0.10.4

I was amending a functions file today and when I got the field names wrong, I got a warning:

2019-01-19 16:11:36,751 WARNING [mqttwarn] Cannot invoke filter function logging_filter defined in logging/hare: 'rhostname'

I had:

if data['rhostname'] ==  'foo'     and data['host'] in ['bar', ...]

I had copy pasted and tried to reverse the fields. This is what I needed:

if data['rhost'] ==  'foo'     and data['hostname'] in ['bar', ...]

I interpreted the message as: cannot invoke this function … because I can’t find it. But wait, … it’s right there, what’s going on?

I didn’t realize it was more like a syntax error or a field which mqttwarn could not access.

Yes, I see now that ‘rhostname’ is mentioned in the message, but that didn’t help me understand that I was “doing it wrong”. I was chasing the wrong thing.

Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jpmenscommented, Jan 20, 2019

I will add a note to the documentation.

1reaction
jpmenscommented, Jan 19, 2019

Nothing can help you find logical errors: Consider

a = 1
a = a + 3

but you wanted to add 2… Exaggerated but I’m trying to prove a point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thinking About Errors in Your Code Differently - Codecademy
The first line says that the JavaScript engine doesn't think that .filter() is a function — but it should be, so there might...
Read more >
The 7 Most Common Types of Errors in Programming and ...
Interface errors occur when there is a disconnect between how you meant your program to be used and how it is actually used....
Read more >
Fix program errors and improve code - Visual Studio (Windows)
This article describes some basic ways Visual Studio can help you find and fix problems in your code, including build errors, code analysis, ......
Read more >
Oh, no, errors! (And how to deal with them) | Programming ...
Type Error. Using the wrong type, e.g. trying to call a number constant like a function. What to do? Make sure you use...
Read more >
Python code doesn't execute. No errors showed - Stack Overflow
In python, main is not a special function (unlike C, for example). You need to explicitly call main() in your script.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found