[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting a table from commandline output
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 8 Nov 2011 08:13:28 +0200
On Tue, Nov 8, 2011 at 5:36 AM, HyperHacker <hyperhacker@gmail.com> wrote:
> Is an alert something that can be caught with pcall? That seems like
> the most sensible way for an iterator to handle errors.
Of course, but you have to know that this corner case can throw an error.
It would be possible to wrap the lines() method in an iterator that uses pcall.
for line in safe(f:lines()) do .. end
steve d.