Learn how to handle command errors in XSOAR using the return_error() function.
Table of Contents
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?
A. Using the demisto_error() function
B. Using a print statement
C. Using the demisto.debug() function
D. Using the return_error() function
Answer
D. Using the return_error() function
Explanation
In XSOAR, the return_error() function is used to return an error entry back into XSOAR if a particular command errors out. This function takes a string argument, which is the error message to be displayed. When this function is called, the execution of the current script is stopped, and an error entry is added to the War Room with the provided error message.
The other options are not correct:
- A. Using the demisto_error() function: There is no function called demisto_error() in XSOAR.
- B. Using a print statement: Print statements are used for displaying information to the console, not for returning error entries.
- C. Using the demisto.debug() function: This function is used for logging debug information, not for returning error entries.
Palo Alto Networks Certified Security Automation Engineer PCSAE certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Palo Alto Networks Certified Security Automation Engineer PCSAE exam and earn Palo Alto Networks Certified Security Automation Engineer PCSAE certification.