Products & Services Solutions Academia Support User Community Company

Learn more about Parallel Computing Toolbox   

ErrorMessage - Message from task error

Description

If an error occurs during the task evaluation, ErrorMessage contains the message property of the MException thrown. ErrorMessage can also indicate if the task did not complete because of cancellation or worker crash.

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'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.

Examples

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.

See Also

Properties

Error, ErrorIdentifier, Function

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS