nerdexam
Microsoft

MB6-704 · Question #23

You have a job that contains the following X++ code: (Line numbers are included for reference only.) You need to identify which code must be inserted at line 10 to ensure that line 12 executes…

The correct answer is D. Catch (exception::numeric). A numeric exception is thrown when a problem occurs during the use of any numerical function as is clearly the case in this code sample. In X++, an exception is represented by a value of the enum named Exception. A frequently thrown exception is Exception::error enumeration…

Develop X++ code

Question

You have a job that contains the following X++ code: (Line numbers are included for reference only.) You need to identify which code must be inserted at line 10 to ensure that line 12 executes. Which code segment should you insert at line 10?

Options

  • ACatch (exception::error)
  • BCatch (exception::warning)
  • CCatch (exception::sequence)
  • DCatch (exception::numeric)

How the community answered

(38 responses)
  • A
    13% (5)
  • B
    5% (2)
  • C
    11% (4)
  • D
    71% (27)

Explanation

A numeric exception is thrown when a problem occurs during the use of any numerical function as is clearly the case in this code sample. In X++, an exception is represented by a value of the enum named Exception. A frequently thrown exception is Exception::error enumeration value. The catch statements are processed in the same sequence that they appear in the X++ code. It is common to have the first catch statement handle the Exception::Error enumeration value. One strategy is to have the last catch statement leave the exception type unspecified. This means it handles all exceptions that are not handled by a previous catch. This strategy is appropriate for the outermost try - catch blocks. try { /* Code here. */ } catch (Exception::Numeric) { info("Caught a Numeric exception."); } catch { info("Caught an

Topics

#exception handling#try-catch#exception types#X++ error handling

Community Discussion

No community discussion yet for this question.

Full MB6-704 Practice