| Contents | Index |
If an error occurs during the task evaluation, ErrorMessage contains the message property of the MException thrown.
Usage | Task object |
Read-only | Always |
Data type | String |
ErrorMessage is empty before an attempt to run a task, and remains empty if the evaluation of a task object function does not produce an error or if the error did not provide a message. ErrorMessage has the same value as the message property of the task's Error.
When using a job manager, ErrorMessage indicates if a worker has crashed during task execution, but when using a different scheduler ErrorMessage does not indicate a crash.
Retrieve the error message from a task object.
jm = findResource('scheduler','type','local');
j = createJob(jm);
a = [1 2 3 4]; % Note: matrix not square.
t = createTask(j, @inv, 1, {a});
submit(j)
waitForState(j)
e_msg = get(t,'ErrorMessage')
e_msg =
Matrix must be square.
Error, ErrorIdentifier, Function

See how to solve large problems with minimal effort and reduce simulation time.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |