octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change cellfun to provide error handler with stack information?


From: Olaf Till
Subject: Change cellfun to provide error handler with stack information?
Date: Fri, 9 Oct 2015 21:04:13 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

'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, among others, the error message, but not 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.

Could a patch to cellfun, for setting an additional field "stack" (as
in the output of 'lasterror()') in the structure passed to the error
handler, potentially be considered? The structure passed by Matlabs
cellfun to the error handler does not contain such a field.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]