nerdexam
Palo_Alto_Networks

PCSAE · Question #104

The XSOAR administrator is writing an automation and would like to return an error entry back into XSOAR if a particular command errors out. How can this be achieved?

The correct answer is D. Using the return_error() function. To properly handle exceptions, wrap the commands with try/except in the main. The return_error() function receives error message and returns error entry back into Cortex XSOAR. https://xsoar.pan.dev/docs/integrations/code-conventions

Automation Concepts

Question

The XSOAR administrator is writing an automation and would like to return an error entry back into XSOAR if a particular command errors out. How can this be achieved?

Options

  • AUsing the demisto_error() function
  • BUsing a print statement
  • CUsing the demisto.debug() function
  • DUsing the return_error() function

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    10% (3)
  • C
    3% (1)
  • D
    83% (24)

Explanation

To properly handle exceptions, wrap the commands with try/except in the main. The return_error() function receives error message and returns error entry back into Cortex XSOAR. https://xsoar.pan.dev/docs/integrations/code-conventions

Topics

#return_error()#automation error handling#Python API#error entries

Community Discussion

No community discussion yet for this question.

Full PCSAE Practice