| Parallel Computing Toolbox™ | ![]() |
ErrorMessage contains the message output from execution of the lasterror command if an error occurs during the task evaluation, or a message indicating that the task did not complete.
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's function does not produce an error or if the error did not provide an message. If a task completes, ErrorMessage has the same value as the message field of the Error property. If a task does not complete because of cancellation or a worker crash, ErrorMessage is set to indicate that fact, and the Error property is left empty.
Retrieve the error message from a task object.
jm = findResource('scheduler','type','jobmanager', ...
'name','MyJobManager','LookupURL','JobMgrHost');
j = createJob(jm);
a = [1 2 3 4]; %Note: matrix not square
t = createTask(j, @inv, 1, {a});
submit(j)
get(t,'ErrorMessage')
ans =
Error using ==> inv
Matrix must be square.
Error, ErrorIdentifier, Function
![]() | ErrorIdentifier | FileDependencies | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |