On Sun, 2 Sep 2007, Glynn Clements wrote:
Maris Nartiss wrote:
Alltough Glynns suggestion about redirecting GRASS error messages ALSO
to some error.log file would be a good idea as this file could be a
must for (crash) bug reporting. Only as a non-programmer I see some
difficulties:
1) How multiple processes (modules) can append data to that file in sane way;
2) When enable such functionality? I.E. g.env set=ERRLOG=true
3) What else needs to be written to such file? I.E. command history,
arch, GRASS version...
I wasn't talking about writing to a "log" file, but a temporary file
which would be used for a single command.
The problem is that Tcl's "exec" command considers it an error if a
subprocess writes anything to stderr. However, a number of modules
That's true - however the error-detecting code in file_option.tcl doesn't
use the return value of catch to determine whether an error has occured or
not - instead it checks the global variable errorcode to see if the
command just run has exited with an error or not.
e.g. something like this:
catch {exec g.proj -c georef=$filepath location=$fileLocation} errMsg
if {[lindex $::errorCode 0] eq "CHILDSTATUS"} {
# Pop-up error dialog here.
It seems to work well but perhaps mightn't cover all eventualities?
Paul
_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev