Error and Exception Handling Flashcards
What are errors?
Errors are events that a particular program can’t normally deal with.
What are the exceptions?
Exceptions are events that are recognized (caught) by the program, categorized, and handled.
What are system exceptions?
Exceptions that are generated from System.Exception, so using this generic type in a TryCatch, for example, will catch all types of errors.
What is a business exception?
A business exception mainly refers to information used in an automated process. Either it may be incomplete or incorrect from a business perspective.
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
- Data with incorrect product codes: Business Exception
- Exceptions defined by the developer: Business Exception
- An error rooted in the fact that certain data is missing or incomplete: Business Exception
- A project where URL needs to open in a browser and that URL is not responding: Application Exception
- A project using the variable with no value: Application exception
- An error rooted in a technical issue: Application exception
When will the “Finally” block be executed?
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).
What does ‘Rethrow’ do?
Rethrow causes the initially thrown exception to be rethrown to handle the exception on an upper level.
Can you use a ‘Rethrow’ activity outside of a ‘Catch’ block?
No
What is the use of ‘Throw’ activity?
It is used to throw an exception though it is not generated by an activity.
If the caught exception is captured by a both parent exception and a child exception which one will be executed?
Th most specific one.
What is the limit as to how many Catches you can use in a Try Catch activity?
None
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
- As long as an error is thrown
- As long as the condition is not met
What is the key difference between TryCatch and Retry Scope?
The difference is that Retry Scope activity simply retries the execution instead of providing a more complex handling mechanism
What happens when the value of the ‘Continue on error’ property is blank?
It stops the execution while throwing an error.
What happens if the ‘Continue on error’ property is set as true on a container activity such as use Browser/application?
Then error thrown by all the activities inside the DO container of respective scope Activity will also be ignored.