[Ohrrpgce] assert that a particular piece of code has a script error?

Ralph Versteegen teeemcee at gmail.com
Tue Jan 9 08:12:54 PST 2018


There's no such feature. Its absence is certainly a nuisance for writing
test cases.
(hspeaktest.py can check for compile-time warnings and errors, but not
run-time ones)

I didn't have any ideas for a try/except block statement. I thought that
people wouldn't use it much since most wouldn't be familiar with
exceptions, and the additional complexity, didn't seem to justify it.
But maybe a more coarse-grained ability to specify a global (or per-script
or per-fibre) error handler would be useful. Either just for our purposes,
or as a public feature.
Incidentally, lua doesn't have try/except, but it has a special way to call
a function so that you catch errors inside it (pcall).

On 9 January 2018 at 05:17, James Paige <Bob at hamsterrepublic.com> wrote:

> I was working on some ellipse slice tests, and I realized that I am not
> aware of any way to assert that a script error has occurred.
>
> ...And as I am typing this, I realize that feature would be almost the
> same thing as having a python-style try/except structure.
>
> Do we have any plans for try/except in the future?
>
> And if we did, how would it handle the difference between
> runtime-hide-all-errors and test-time-show-all-errors?
>
> ---
> James
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20180110/5766d381/attachment.html>


More information about the Ohrrpgce mailing list