Re: [textadept] insufficient error checking

From: mitchell <>
Date: Mon, 13 Dec 2010 11:35:55 -0500 (Eastern Standard Time)


> I work a lot with shared folders, and I've noticed that when one
> disappears for a bit, the error processing is basically nonexistent.
> For instance, when a shared folder of a file I am working on
> disappears, and I try to save the file, I get this error:
> C:\textadept/core/file_io.lua:243: attempt to index a nil value
> Besides the annoying behavior of splitting the window to present the
> error, the message itself is incomprehensible. Is it possible to
> present errors in a less intrusive and more informative manner?
> Whether saying the file can't be saved, or something like that.
> I checked out the lfs extension a bit, and it seems woefully limited
> compared to what I am used to in Perl (my language of choice) with its
> large complement of native file test operators (including something as
> simple as whether a file even exists!). Is there a more featureful
> alternative?

I assumed an error will be thrown on line 238 if the file cannot be opened
for writing so the error on 243 you are getting wouldn't happen. It's
strange that it is. A quick fix would be to insert:

if not lfs.attributes(filename) then error('File not found') end

just before 238 (after the iconv).

If this fixes the problem, let me know. I'm curious to know that if a
write error isn't thrown but the lfs one is, what file is being written


> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Received on Mon 13 Dec 2010 - 11:35:55 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:56:49 EST