<div dir="ltr">On Tue, Apr 2, 2013 at 5:03 AM,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com" target="_blank">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><span style="color:rgb(34,34,34)">Hi byrsa,</span><br></div></div>
<br>
The behavior you&#39;re describing does sound wrong.  However, I wasn&#39;t able<br>
to reproduce it locally.  Running your example, I get [] for<br>
<a href="http://megaupload.com" target="_blank">megaupload.com</a>, not an error.  Perhaps there is a tricky DNS server<br>
involved somewhere that is changing the response unexpectedly?  I<br>
suggest using something like tcpdump or wireshark to take a look at the<br>
actual traffic and perhaps produce a more deterministic demonstration of<br>
the problem.<br>
<br></blockquote><div><br></div><div style>You are correct! I was running the code on a Linux machine and the &#39;dig&#39; command on my Macbook. The answers were different. At least I know the code is working!</div><div>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regarding how you should detect certain errors, though, Failure just<br>
wraps normal exceptions, so you can use `isinstance` to check for them<br>
instead of checking by name.  Failure also provides some APIs that wrap<br>
up isinstance to provide some more commonly useful behavior - see<br>
Failure.check and Failure.trap.<br>
<br></blockquote><div><br></div><div style>&#39;isinstance&#39; was my initial thought, as well. I&#39;ll have to re-visit that. Thanks for the pointer. </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

And regarding determining error from a Message, you can use the rCode<br>
attribute to get the raw server response code as an integer.  The values<br>
and their meanings are defined in the DNS RFC and there are symbolic<br>
constants in twisted.names.dns - eg OK, ENAME, ESERVER, etc.<br>
<br></blockquote><div><br></div><div style>That doesn&#39;t sound too bad. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hope this helps,<br>
Jean-Paul<br>
<br></blockquote><div><br></div><div style>Your feedback has been immensely helpful, thanks a lot, Jean-Paul! </div><div style><br></div><div style> byrsa</div></div></div></div>