<br><br><div class="gmail_quote">On Fri, Jul 12, 2013 at 5:33 PM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On 07/11/2013 05:43 AM, Thomas Hervé wrote:<br>
><br>
><br>
</div><div class="im">> On Thu, Jul 11, 2013 at 1:49 AM, Monty Taylor <<a href="mailto:mordred@inaugust.com">mordred@inaugust.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:mordred@inaugust.com">mordred@inaugust.com</a>>> wrote:<br>
><br>
>     I'd like top-post and hijack this thread for another exception related<br>
>     thing:<br>
><br>
>     a) Anyone writing code such as:<br>
><br>
>     try:<br>
>       blah()<br>
>     except SomeException:<br>
>       raise SomeOtherExceptionLeavingOutStackContextFromSomeException<br>
><br>
>     should be mocked ruthlessly.<br>
><br>
><br>
> i don't think mocking is a good way to convey your point. Losing<br>
> tracebacks is not great, but having an API raising random exceptions is<br>
> probably worse. Can you develop?<br>
<br>
</div>I have learned that I may have mis-read your last three words due to<br>
translation problems. You were not asking if I had the ability to write<br>
code, rather you were asking if I could elaborate.<br></blockquote><div><br></div><div>Ah thanks, and sorry for the frenchism.</div><div><br></div><div>I think I understand your point now, which is not so much about tracebacks but about context in the wide sense, ie enough information to understand what's going on. I've found that we're not necessarily doing a great job at testing the error messages: it's nice to know that FooError has been raised, but if the message is 'Error' it leads to what you're describing, where you need to look at the code and potentially change it to debug it. I believe more consistent tests may help that a bit.</div>
<div><br></div><div>Cheers,</div><div><br></div><div>-- </div><div>Thomas</div><div> </div></div>