[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #8768] new field for stack info in structu
From: |
Olaf Till |
Subject: |
[Octave-patch-tracker] [patch #8768] new field for stack info in structure passed to error handler of cellfun |
Date: |
Mon, 12 Oct 2015 10:48:29 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.3.0 |
URL:
<http://savannah.gnu.org/patch/?8768>
Summary: new field for stack info in structure passed to
error handler of cellfun
Project: GNU Octave
Submitted by: i7tiol
Submitted on: Mon 12 Oct 2015 10:48:27 AM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
'cellfun' can be passed an error handler. In case the user function produces
an error, the error handler is called with the arguments of the user function
and an additional structure with error information. The return value of the
error handler is returned as an element of the return values of cellfun.
The structure with error information, passed to the error handler, contains
the fields 'identifier' (error identifier), 'message' (error message), and
'index' (index of argument set for user function). However, it does not
contain the error stack. This hinders finding the erroneous code in the user
function.
This is not a big issue if only cellfun is used, since one can call it without
an error handler to see the error stack of the user function directly. But in
parallel execution, as with parcellfun or the new netcellfun, the errors of
the child processes are caught and their messages can only be seen by
examining the output of the error handler. It's no great problem to pass stack
information to the error handler in parcellfun and netcellfun. But in some
cases (chunked evaluation) these functions internally call cellfun, so for
consistency, stack information should also be passed to the error handler by
cellfun, so that this information is available to parcellfun and netcellfun.
The stack can be passed in the field 'stack', and can be the same as the
corresponding field returned by the function 'lasterror'.
Matlabs cellfun does not set the field 'stack' for the error handler, so the
main problem should be to decide if we want to set it or not. The
implementation itself is only one line, so I barely see the need to provide a
changeset, but here it is.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Mon 12 Oct 2015 10:48:27 AM GMT Name: err_handler_stack_info.cset
Size: 822B By: i7tiol
<http://savannah.gnu.org/patch/download.php?file_id=35164>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?8768>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-patch-tracker] [patch #8768] new field for stack info in structure passed to error handler of cellfun,
Olaf Till <=