PrepAway - Latest Free Exam Questions & Answers

Which code pattern is used to handle errors after execution of an operation?

Which code pattern is used to handle errors after execution of an operation?

PrepAway - Latest Free Exam Questions & Answers

A.
IDfOperationMonitor myOpMonitor = …;
operation.setOperationMonitor(myOpMonitor);
if (! operation.execute())
{
// handle errors using myOpMonitor
}

B.
if (!operation.execute())
{
…
operation.reportError(…);
…
}

C.
if (!operation.execute())
{
…
operation.logError(…);
…
}

D.
if (!operation.execute())
{
…
operation.getErrors();
…
}


Leave a Reply