wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

W10 - ITEW2 REVIEWER

Total questions: 27

Worksheet time: 14mins

Name
Class
Date
1.
To unify error handling, we’ll use the throw operator.
a)
TRUE
b)
FALSE
2.
A script “dies” (immediately stops) in case of an error, printing it to console.
a)
TRUE
b)
FALSE
3.
The “rethrowing” technique can be explained in more detail as: Catch gets all errors.
a)
TRUE
b)
FALSE
4.
__________ can only handle errors that occur in valid code.
a)
try
b)
try...catch
c)
catch
d)
catch and try
5.
The “rethrowing” technique can be explained in more detail as: In the catch (err) {...} block we analyze the error object err
a)
TRUE
b)
FALSE
6.
The finally clause is a great place to finish the measurements no matter what.
a)
TRUE
b)
FALSE
7.

Allows you to define a block of code to be tested for errors while it is being executed. The catch statement allows you to define a block of code to be executed, if an error occurs in the try block.

(a)  

8.

The (a)   , could use another word instead of err

9.
For instance, for an undefined variable that’s "ReferenceError".
a)
message
b)
name
10.
Textual message about error details.
a)
message
b)
name
11.

A string with information about the sequence of nested calls that led to the error. Used for debugging purposes.

(a)  

12.

The (a)   generates an error.

13.
In JavaScript, there has many built-in constructors for standard errors: Error, SyntaxError, ReferenceError, TypeError and others. We cannot use them to create error object as well.
a)
TRUE
b)
FALSE
14.
Catch should not only process errors that it knows and “rethrow” all others.
a)
TRUE
b)
FALSE
15.

Usually, we can check the error type using the (a)   operator.

16.
The “rethrowing” technique can be explained in more detail as: If we don’t know how to handle it, we do try err.
a)
TRUE
b)
FALSE
17.
The catch block actually handles only errors that it knows how to deal with and “skips” all others.
a)
TRUE
b)
FALSE
18.

The (a)   clause is often used when we start doing something and want to finalize it in any case of outcome.

19.
If an error object is not needed, we can omit it by using catch { instead of catch (err) {
a)
TRUE
b)
FALSE
20.
Wrapping exceptions is a widespread technique: a function handles low-level exceptions and creates higherlevel errors instead of various low-level ones.
a)
TRUE
b)
FALSE
21.
The human-readable error message.
a)
message
b)
name
c)
stack
22.
the string with error name (error constructor name).
a)
message
b)
name
c)
stack
23.
For errors in database operations, we may need __________.
a)
HttpError
b)
DbError
c)
NotFoundError
24.
For errors in network operations, we may need __________ .
a)
HttpError
b)
DbError
c)
NotFoundError
25.
We cannot inherit from Error and other built-in error classes normally. We just need to take care of the name property and don’t forget to call super.
a)
TRUE
b)
FALSE
26.
For errors in searching operations, we may need __________ .
a)
HttpError
b)
DbError
c)
NotFoundError
27.
We can use instanceof to check for particular errors.
a)
TRUE
b)
FALSE