My coding error in a function doesn't indicate it's a coding error
See original GitHub issueI’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:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will add a note to the documentation.
Nothing can help you find logical errors: Consider
but you wanted to add
2
… Exaggerated but I’m trying to prove a point.