Error and Exception Handling Flashcards

1
Q

What are errors?

A

Errors are events that a particular program can’t normally deal with.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the exceptions?

A

Exceptions are events that are recognized (caught) by the program, categorized, and handled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are system exceptions?

A

Exceptions that are generated from System.Exception, so using this generic type in a TryCatch, for example, will catch all types of errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a business exception?

A

A business exception mainly refers to information used in an automated process. Either it may be incomplete or incorrect from a business perspective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Match following items to Application exceptions and Business exceptions.
1. Data with incorrect product codes
2. Exceptions defined by the developer
3. An error rooted in the fact that certain data is missing or incomplete
4. A project where URL needs to open in a browser and that URL is not responding
5. A project using the variable with no value
6. An error rooted in a technical issue

A
  1. Data with incorrect product codes: Business Exception
  2. Exceptions defined by the developer: Business Exception
  3. An error rooted in the fact that certain data is missing or incomplete: Business Exception
  4. A project where URL needs to open in a browser and that URL is not responding: Application Exception
  5. A project using the variable with no value: Application exception
  6. An error rooted in a technical issue: Application exception
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When will the “Finally” block be executed?

A

The Finally block is only executed when no exceptions are thrown or when an exception is caught and handled in the Catches block (without being re-thrown).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does ‘Rethrow’ do?

A

Rethrow causes the initially thrown exception to be rethrown to handle the exception on an upper level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can you use a ‘Rethrow’ activity outside of a ‘Catch’ block?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the use of ‘Throw’ activity?

A

It is used to throw an exception though it is not generated by an activity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If the caught exception is captured by a both parent exception and a child exception which one will be executed?

A

Th most specific one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the limit as to how many Catches you can use in a Try Catch activity?

A

None

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In which of the following two cases does the Retry Scope retry the contained activities?
1. As long as an error is thrown
2. As long as the condition is met
3. As long as the condition is met and an error is thrown
4. As long as the condition is not met

A
  1. As long as an error is thrown
  2. As long as the condition is not met
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the key difference between TryCatch and Retry Scope?

A

The difference is that Retry Scope activity simply retries the execution instead of providing a more complex handling mechanism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens when the value of the ‘Continue on error’ property is blank?

A

It stops the execution while throwing an error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens if the ‘Continue on error’ property is set as true on a container activity such as use Browser/application?

A

Then error thrown by all the activities inside the DO container of respective scope Activity will also be ignored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How many Global Exception Handlers a project can have?

A

Only one

17
Q

What happens if the ContinueOnError Property is set to True?
1. The execution of the project continues regardless of any error
2. The execution of the project stops based on the error
3. The execution is retried
4. An error is thrown

A
  1. The execution of the project continues regardless of any error
18
Q

What are the options available for the developer when an error is encountered during an execution?

A
  1. Continue - The exception is re-thrown.
  2. Ignore - The exception is ignored, and the execution continues from the next activity.
  3. Retry - The activity which threw the exception is retried.
  4. Abort - The execution stops after running the current handler.
19
Q

Is Global Exception Handler available to use in library projects?

A

No, only processes

20
Q

The Global Exception Handler has two arguments, errorInfo and result. What are their directions?

A

errorInfo has IN direction and result has OUT direction

21
Q

What is the most effective way to handle the click on a UI Element that is not always available?
1. Place the Click activity inside a Try/Catch block.
2. Use an Element Exists activity and then a Click activity.
3. Use a Find Element Activity.
4. Set the ContinueOnError property of the Click activity to True.

A
  1. Place the Click activity inside a Try/Catch block.
22
Q

You have more than one exception type defined in the Catch block and an exception occurs that fits two types. Which one of the following block is executed?
1. All matching blocks in the order they are defined
2. The block with most generic match
3. The first match defined
4. The block with most specific match

A
  1. The block with most specific match
23
Q

The Retry Scope activity can be used without a termination condition. What does this infer?
1. The Retry Scope Activity retries just once.
2. The Retry Scope Activity retries the activities indefinitely.
3. The Retry Scope Activity retries the activities until no exception occurs (or the provided number of attempts is exceeded).
4. It throws an exception.

A
  1. The Retry Scope Activity retries the activities until no exception occurs (or the provided number of attempts is exceeded).
24
Q

The Global Exception Handler is designed to determine the project’s behavior when encountering an execution error. What is a Global Exception Handler?
1. an activity
2. a menu
3. a property
4. a type of workflow

A
  1. a type of workflow
25
Q

What can you use to make sure that execution continues even if an Activity fails?
1. AddThe DelayAfter property
2. The Throw activity
3. The TimeoutMS property
4. Surround the activity with Try/Catch Activity

A
  1. Surround the activity with Try/Catch Activity
26
Q

Which of the following is recommended to have in a Catch block?
A. An alternative to the approach that fails
B. An Input Dialog activity
C. A LogMessage activity
D. No Activity

A

A. An alternative to the approach that fails
C. A LogMessage activity

27
Q

What is the maximum number of Catch blocks that can be used in a Try Catch activity in UiPath Studio?

Three

Five

Ten

Unlimited

A

Unlimited

Technically, there is no specific limit to the number of Catch blocks you can use within a Try Catch activity in UiPath Studio. You can include multiple Catch blocks to handle different types of exceptions as needed. However, it’s important to consider the readability and maintainability of your code when deciding the number of Catch blocks to include.

28
Q

Which of the following scenarios triggers the Retry Scope to retry the contained activities?

Choose the two options that apply

As long as an error is thrown.

As long as the condition is met.

As long as the condition is met and an error is thrown.

As long as the condition is not met.

A

As long as an error is thrown.

As long as the condition is not met.

29
Q

What happens if the “ContinueOnError” Property is set to True?

Choose one of the options below

The activity stops executing and throws an error.

The execution of the project stops due to the error.

The execution of the project continues regardless of any error.

The activity retries the operation until successful.

A

The execution of the project continues regardless of any error.

30
Q

Review question: To use a selector in the selector property of an activity, you can store it in a variable. What’s the variable type?

UiElement

String

Boolean

Int32

A

String

31
Q

Review question: Which of the following methods can be used to populate a list of strings type variable with the values John, Paul, George, and Ringo?

Choose the two options that apply

Initialize the variable with New List(of String) and use Build Collection activity to populate the list.

Set the Default value, in the Data Manager panel, to {“John”, “Paul”, “George”, “Ringo”}

Set the Default value, in the Variables panel, to New List(of String) from {“John”, “Paul”, “George”, “Ringo”}

Leave the Default value blank and use Add To Collection activities to populate the list.

A

Initialize the variable with New List(of String) and use Build Collection activity to populate the list.

Set the Default value, in the Variables panel, to New List(of String) from {“John”, “Paul”, “George”, “Ringo”}

32
Q

Which of the following is recommended to have in a Catch block?

Choose the two options that apply

The activity or set of activities to be performed when an error occurs.

A Log Message activity.

There’s no need to add an activity in the Catch block.

The activity performed which has a chance of throwing an error.

A

The activity or set of activities to be performed when an error occurs.

A Log Message activity.

33
Q

What is the most effective way to handle the click on a UI Element that is not always available?

Choose one of the options below

Place the Click activity inside a Try Catch.

Set the ContinueOnError property of the Click activity to True.

Use an Element Exists activity and then a Click activity.

Use a Find Element activity.

A

Place the Click activity inside a Try Catch.

34
Q

Which activity is being described by the following statement: “When checking whether a particular condition is met, only activities that return a Boolean value can be used in the Condition block (e.g. IsTrue, IsFalse, Element Exists)”?

Choose one of the options below

Retry Scope

If

Switch

Try Catch

A

Retry Scope

35
Q

What does it imply when the Retry Scope activity is used without a termination condition?

Choose one of the options below

It throws an exception.

The Retry Scope activity retries just once.

The Retry Scope activity retries the activities until no exception occurs (or the provided number of attempts is exceeded).

The Retry Scope activity retries the activities indefinitely.

A

The Retry Scope activity retries the activities until no exception occurs (or the provided number of attempts is exceeded).

36
Q

You have more than one exception type defined in the Catch block and an exception occurs that fits two types. Which one of the following block is executed?

Choose one of the options below

The block with most specific match.

All matching blocks in the order they are defined.

The block with most generic match.

The first match defined.

A

The block with most specific match.

37
Q

How can you ensure execution continues even if an activity fails?

Choose the two options that apply

Use a Throw activity.

Surround the activity with a Try Catch activity.

Set the ContinueOnError property to True.

Increase the timeout duration for the activity.

Set the Delay after property for that activity.

A

Surround the activity with a Try Catch activity.

Set the ContinueOnError property to True.

38
Q

Which exception type is being described by the following statement: “Occurs when using a variable with no set value (not initialized)”?

Choose one of the options below

ApplicationException

BusinessRuleException

NullReferenceException

SelectorNotFoundException

A

NullReferenceException