Loading tutorials
try, catch, and finally. Now you need to know which exception types to 5 min readtry/catch/finally block and know the common built-in exception types such as QueryException and DmlException. It covers what an exception object tells you after you catch it, and how to pull that information out reliably.4 min readtry/catch/finally block and that you know the common built-in exception types, such as DmlException, QueryException, and NullPointerException. It covers how Apex chooses between several catch blocks, why the generic Exception block goes last4 min readtry, catch, and finally, and throw an exception with throw. Earlier chapters covered the built-in types such as DmlException and QueryException. Here you will define your own.5 min readgetMessage and getTypeName. Here you will learn how to catch a low-level exception, throw a more meaningful one in its place, and keep the original fai5 min readaddError, a record locked by another transaction. In all of these cases Apex throws a DmlException. This chapter covers how to catch it, how to find out which records failed and wh4 min readtry, catch, and DmlException from the previous chapters.5 min readDmlException, and know that one Apex execution context is one database transaction. It covers how to undo part of a transaction yourself when you catch an error.4 min readDmlException, as covered in earlier chapters. It also assumes you know what an @AuraEnabled method is. Here you will see what a Lightning component receives when Apex fails, and how to make that message use4 min readDmlException (earlier chapters). You should also know the basics of Queueable, Batch, and @future Apex.5 min read@IsTest, and that you have read the earlier chapters on try/catch, custom exceptions, and DML errors. Here you will learn how to prove that your code fails in the way you designed.4 min readtry, catch, finally, custom exceptions, causes, DML errors, savepoints, AuraHandledException, and tests. This chapter combines them into one approach you can apply across a codebase.5 min read