Uncategorized
A lament for the lost art of error messages
Dec 18th
Once upon a time, programmers cared about the people who ran their programs. They would try to help users when things went wrong by giving some context and explanation to why something went wrong.
I’ve just tried to install func from source on debian squeeze and it reeks of “Today’s Programmer” whose agile methodology means nothing helpful is offered, you should read the source to understand it.
1) The wiki install instructions say, “The root level makefile” – what the one in the docs folder? Fortunately if you’ve used python setup.py before, or can intuit –help then you’re not too stalled.
2) The bdist_dumb produces /usr/local/ prefixed paths (but puts things in dist-packages)
3) The install –prefix=/usr puts things in site-packages.
4) The init script is hard coded for /usr/bin (sorry, bdist_dumb, this will need editing)
5) If you persevered with /usr/local installed, you’ll have no modules. Func won’t find them.
6) IT WON’T TELL YOU WHY (possibly because it hasn’t discovered the logger.py)
7) IT WON’T EVEN TELL YOU IF YOU RUN IT IN FOREGROUND
Wiki does get quite specific about modules being under a specific tree though, soo…
9) site-packages isn’t in the sys.path on debian.
9.1) IT WON’T TELL YOU THIS IS THE PROBLEM
10) adding site-packages to PYTHONPATH before starting makes it load, but the same no-modules and no func.log
Finally, moving the files to dist-packages fixes it all up and everything works.
No wonder no-one seems to persevere long enough to package it.
I’m not going to package it out of sheer frustration.
Func isn’t alone, but it’s really great at the art of I’ll throw you a stack trace, then you can read the code and determine why it failed. Chef is similar.
What happened to I tried to object.method with arguments foo, bar and I got the error BLEH.
Maybe include a stack trace after that, but jeez, your users shouldn’t have to be programmers intimately familiar with coding for your chosen language and the vagaries therein.
I remember the last time I tried to debug a failing recipe in chef, this is a subclass of this, which is a subclass of that, which inherits from somewhere else completely, just to find the line of code that was being executed.
Edging nearer
Jan 31st
OK, there’s a big difference between UTF8 and Unicode. What did I think I was sending? What was I sending? *sigh*
my $uname=pack(“n*”,unpack(“C0U*”,$name));
This will convert UTF8 into Unicode in Perl (should you ever need to).
It’s no longer “ignoring me” per se: I can see it recognised my message. But it still isn’t displaying them on screen. Time to capture some more traffic from Windows Blister.
08:08:13.763007 IP 192.168.1.4.60969 > 192.168.1.7.9003: UDP, length 54
0×0000: 4500 0052 1464 0000 4011 e2db c0a8 0104 E..R.d..@…….
0×0010: c0a8 0107 ee29 232b 003e 65d7 0400 0000 …..)#+.>e…..
0×0020: 91ad e7a5 77a7 4d0f 9f74 9645 a900 25b5 ….w.M..t.E..%.
0×0030: a8fb 0750 13d3 9f43 bea2 a502 01d3 e9a8 …P…C……..
0×0040: 0000 0000 0a00 0000 0043 006c 006f 0063 ………C.l.o.c
0×0050: 006b .k
08:08:17.210158 IP 192.168.1.7.1289 > 255.255.255.255.9004: UDP, length 56
0×0000: 4500 0054 06d9 0000 8011 7211 c0a8 0107 E..T……r…..
0×0010: ffff ffff 0509 232c 0040 dbdc a8fb 0750 ……#,.@…..P
0×0020: 13d3 9f43 bea2 a502 01d3 e9a8 2800 0000 …C……..(…
0×0030: 91ad e7a5 77a7 4d0f 9f74 9645 a900 25b5 ….w.M..t.E..%.
0×0040: 3f35 a5a9 4b2d ce47 93ee 759f 3a7d da4f ?5..K-.G..u.:}.O
0×0050: 0000 0000 ….
Recent Comments