Re: [textadept] insufficient error checking

From: Robert <ro....at.web.de>
Date: Mon, 13 Dec 2010 16:39:52 +0100

Hi Scott,

On Mon, Dec 13, 2010 at 10:06 AM, Scott Weisman <sweis....at.gmail.com> wrote:
> 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.

Usually, there are meaningful error messages. Presenting them in a
buffer has the advantage that it's easy to copy the message to a mail.
>
> 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?
>

As I understand the save function, opening the file for writing does
the check for existence (see also "Programming in Lua", Ch.8.3 [1].
Can you reproduce this error by disconnecting your shared folder?
Maybe, the connection dropped after checking, but before actually
saving.
At work I used shared folders in a Windows environment a lot with
Textadept and never had problems. You might consider using the
buffer_before_save or buffer_after_save events for making a local
backup.

In any case, I hope you didn't loose any important data and recommend
filing a bug at the Google code issue tracker [2].

Robert

[1] http://www.lua.org/pil/8.3.html
[2] http://code.google.com/p/textadept/issues/list
Received on Mon 13 Dec 2010 - 10:39:52 EST

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