Skip to Main Content Skip to Search
Product Documentation

ErrorMessage - Message from task error

Description

If an error occurs during the task evaluation, ErrorMessage contains the message property of the MException thrown.

Characteristics

Usage

Task object

Read-only

Always

Data type

String

Values

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.

Examples

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.

See Also

Properties

Error, ErrorIdentifier, Function

  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS