Exception Errors Flashcards

1
Q

AsyncException

A

Any problem with an asynchronous operation, such as failing to enqueue an asynchronous call.

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

BigObjectException

A

Any problem with big object records, such as connection timeouts during attempts to access or insert big object records.

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

CalloutException

A

Any problem with a Web service operation, such as failing to make a callout to an external system.

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

DmlException

A

Any problem with a DML statement, such as an insert statement missing a required field on a record.

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

EmailException

A

Any problem with email, such as failure to deliver. For more information, see Outbound Email.

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

ExternalObjectException

A

Any problem with external object records, such as connection timeouts during attempts to access the data that’s stored on external systems.

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

IllegalArgumentException

A

An illegal argument was provided to a method call. For example, a method that requires a non-null argument throws this exception if a null value is passed into the method.

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

InvalidParameterValueException

A

An invalid parameter was supplied for a method or any problem with a URL used with Visualforce pages. For more information on Visualforce, see the Visualforce Developer’s Guide.

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

LimitException

A

A governor limit has been exceeded. This exception can’t be caught.

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

JSONException

A

Any problem with JSON serialization and deserialization operations. For more information, see the methods of System.JSON, System.JSONParser, and System.JSONGenerator.

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

ListException

A

Any problem with a list, such as attempting to access an index that is out of bounds.

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

MathException

A

Any problem with a mathematical operation, such as dividing by zero.

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

NoAccessException

A

Any problem with unauthorized access, such as trying to access an sObject that the current user does not have access to. This exception is used with Visualforce pages. For more information on Visualforce, see the Visualforce Developer’s Guide.

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

NoDataFoundException

A

Any problem with data that does not exist, such as trying to access an sObject that has been deleted. This exception is used with Visualforce pages. For more information on Visualforce, see the Visualforce Developer’s Guide.

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

NoSuchElementException

A

This exception is thrown if you try to access items that are outside the bounds of a list. This exception is used by the Iterator next method. For example, if iterator.hasNext() == false and you call iterator.next(), this exception is thrown. This exception is also used by the Apex Flex Queue methods and is thrown if you attempt to access a job at an invalid position in the flex queue.

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

NullPointerException

A

Any problem with dereferencing null, such as in the following code:

String s;
s.toLowerCase(); // Since s is null, this call causes
// a NullPointerException

17
Q

QueryException

A

Any problem with SOQL queries, such as assigning a query that returns no records or more than one record to a singleton sObject variable.

18
Q

RequiredFeatureMissing

A

A Chatter feature is required for code that has been deployed to an organization that does not have Chatter enabled.

19
Q

SearchException

A

Any problem with SOSL queries executed with SOAP API search() call, for example, when the searchString parameter contains fewer than two characters. For more information, see the SOAP API Developer Guide.

20
Q

SecurityException

A

Any problem with static methods in the Crypto utility class. For more information, see Crypto Class.

21
Q

SerializationException

A

Any problem with the serialization of data. This exception is used with Visualforce pages. For more information on Visualforce, see the Visualforce Developer’s Guide.

22
Q

SObjectException

A

Any problem with sObject records, such as attempting to change a field in an update statement that can only be changed during insert.

23
Q

StringException

A

Any problem with Strings, such as a String that is exceeding your heap size.

24
Q

TypeException

A

Any problem with type conversions, such as attempting to convert the String ‘a’ to an Integer using the valueOf method.

25
Q

VisualforceException

A

Any problem with a Visualforce page. For more information on Visualforce, see the Visualforce Developer’s Guide.

26
Q

XmlException

A

Any problem with the XmlStream classes, such as failing to read or write XML.

27
Q

Exceptions show errors and other events that disrupt the normal flow of code execution. Which of the following statements are true about Apex Exception Handling?

Choose 3

A. You can have multiple Catch blocks to catch all different kinds of exceptions. If you use a generic exception catcher, it must be the first Catch block.
B. The finally statement is required and gets executed after the catch block executes.
C. The try statement identifies a block of code in which an exception could occur.
D. The try statement identifies a block of code in which an exception could occur.
E. Comparatively, a throw statement allows you to signal that an error has occurred, while try, catch, and finally can be used to pull through from an exception

A

C. The try statement identifies a block of code in which an exception could occur.

D. The try statement identifies a block of code in which an exception could occur.

E. Comparatively, a throw statement allows you to signal that an error has occurred, while try, catch, and finally can be used to pull through from an exception

28
Q

True or False

A finally block is required in a try, catch, finally statement

A

False

29
Q

What does a throw statement do?

A

A throw statement allows you to signal that an error has occurred

30
Q

Try-catch-finally statements are used to…

A

The try, catch, and finally statements can be used to gracefully recover from a thrown exception

31
Q

what does the ‘try’ in a try-catch-finally statement do?

A

The try statement identifies a block of code in which an exception can occur.

32
Q

what does the ‘catch’ in a try-catch-finally statement do?

A

The catch statement identifies a block of code that can handle a particular type of exception.

33
Q

True or False

Each catch statement must have a unique exception type?

A

True

34
Q

True or False

In try-catch-finally statements, once a particular exception type is caught in one catch block, the remaining catch blocks, if any, aren’t executed.

A

True

35
Q

what does the ‘catch’ in a try-catch-finally statement do?

A

The finally statement identifies a block of code that is guaranteed to execute and allows you to clean up your code.

36
Q

True or False

the finally block in a try-catch-finally statement only executes when an exception is thrown.

A

False

Code in the finally block always executes regardless of whether an exception was thrown or the type of exception that was thrown.