Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [exception]

An exception denotes an error that disrupts the normal flow of code execution.

0
votes
1answer
22 views

SObjectException

As per my understanding, the below code should throw System.SObjectException: SObject row was retrieved via SOQL without querying the requested field, but instead it updated the account phone without ...
-1
votes
1answer
45 views

Database.Upsert not able to prevent AllOrNone

Elaborating the Question:- We have 3 Objects, Branch, Account and Branch Accounts, Branch Accounts is a junction between former 2. Now we are trying to insert Branch Account records via Batch, and in ...
2
votes
1answer
28 views

How to send debug log with email

Assume that We have try catch structure and if exception throw, I want to send all debug log in email as an attachment. Is that possible?
0
votes
1answer
29 views

exception when sending email from Apex when setWhatId is set with recordId

i'm getting an exception when sending email from apex controller class. I'm associating this email with recordId to show it under activity for that record. here is the exception System....
0
votes
1answer
17 views

Unable to update existing(Or) related leads while lead convertion

Currently, I'm working on the parent-child relationship on the lead object. So, we are restricting users to convert only master lead & then top 20 related leads will be converting as contacts to ...
1
vote
0answers
16 views

Reload Visualforce page on session lost

Im trying to reload a Visualforce page when session is lost, due to another login, and sessionId created in a different browser tab. I have code that makes constant calls to the controller methods, ...
3
votes
1answer
78 views

What are “LOB fields” in an asset? Querying all the fields on the asset causes a limit exception, why?

First of all: what are LOB fields? Secondly: I have a complex apex automated process in which I need to make an exact copy of an Asset object (all of its fields). To do this I created a method that ...
7
votes
0answers
58 views

Rethrowing an exception is missing the stackTraceString

I have code that is wrapped into a main try-catch block and then inside of that I have another try-catch which I am using for a specific use case. If the inner try-catch gets triggered I then use a ...
0
votes
2answers
29 views

Create exceptions in test classes for a process builder?

Is is possible to create exceptions in a Test Class for (example) Process Builder "XYZ NAME"? To avoid the test class running that process. Right now my work-around is to manipulate the criteria in ...
8
votes
3answers
219 views

How to Aura Handle multiple DmlExceptions

How should I handle multiple DmlException messages when using AuraHandledException inside an Apex Controller. If I do this: try { upsert value; } catch(DmlException e) { throw new ...
0
votes
3answers
151 views

System.AsyncException: Maximum stack depth has been reached. while writing in test class

I've got a requirement to perform queueable apex in a trigger my class working fine, but while writing a test class for queueable apex I'm getting an exception. Could anybody can help me. Trigger ...
2
votes
1answer
28 views

How to throw or cause an Access Level exception in a test class

anyone know how to throw an access level exception in a test class to cover the below code sample? I'm assuming the object being inserted with Database.insert needs to have sharing settings modified ...
0
votes
0answers
51 views

Exception method getStackTraceString is empty ()

I'm sending any errors that our try/catch blocks catch to Slack and for some reason all the Exception info is filled out apart from the getStackTraceString method. It's a method within a class: try {...
0
votes
2answers
68 views

Insufficient access issue while deleting the record with Public Read/Write sharing settings

User is getting "There's a problem saving this record. You might not have permission to edit it, or it might have been deleted or archived. Contact your administrator for help." exception for a record....
1
vote
2answers
45 views

Cover Error Handling on Test Class

I am having an issue where I have a trigger that rolls up data from contacts to an account. This was working fine with no issues until we added a managed package app that is constantly checking and ...
0
votes
0answers
37 views

@future method not getting called from catch block

I am calling a webservice (synchronous) and in case of CalloutException, I'm trying to create an error log in a custom object. The problem is, the record insertion is happening in a future method and ...
1
vote
2answers
183 views

Exception not being caught; System.FinalException: Cannot modify a collection while it is being iterated

Why is this Exception not being caught? I read that System.LimitException is not caught but didn't see anywhere about System.FinalException. Non-Working Code @AuraEnabled public static List<...
0
votes
1answer
210 views

Read Time Out Exception

I am calling REST API method to update some data to another system from apex but getting "common.apex.runtime.impl.ExecutionException: Read timed out" exception. Here is my request code HttpRequest ...
2
votes
2answers
119 views

Not receiving flow Exception emails

I'm having an issue in my org where I can't make anyone receive the unhandled exception apex emails, so i'm having a test failing on a Process Builder, and I can't fix the issue since I can't receive ...
1
vote
1answer
103 views

Messaging.renderemailtemplate() fails with error: System.EmailTemplateRenderException: UNKNOWN_EXCEPTION: java.lang.NullPointerException

I am trying to render an email using the method: Messaging.renderemailtemplate(), by passing three parameters: templateId,whoId ( user ) ,whatId ( Custom Object ) from a Trigger. The insertion of ...
0
votes
2answers
33 views

Show System error messages in visualforce markup

I wonder, is it possible to show exceptions or any errors, like "Null pointer exception" in visualforce? For now all errors refresh the page and displaying error on the blank page. I want for my ...
0
votes
0answers
204 views

“Connection reset” exception when sending a callout (HTTP.send())

We have been receiving this intermittent exception when trying to make a callout for a few months now ("Connection reset" is the exception message): Connection reset Class.Sip_HttpUtil.callout: ...
2
votes
1answer
224 views

Duplicate Rule Details - How to get in Apex exception

I am getting a duplicate rule issue with apex first error: DUPLICATES_DETECTED, Use one of these records?: [] Now I want this rule to run, however, I need to get the details of the record that is ...
1
vote
1answer
31 views

need to throw an error on specific record from list

I have below method and error is coming beacuse of some validation/trigger is on account and need to catch the exception If i am runnning this from Ui for one record this will throw an exception as i ...
0
votes
1answer
95 views

How to test Exceptions (Query and DML) for ContentDocument?

I try to write wrong query, but I get just error un my test, not coverage. If I use try-catch in unit-test - no error and no coverage either. How to test it right? And how can I test here delete DML ...
2
votes
2answers
766 views

How to capture individual exceptions in bulk record updates

Today I am writing an apex class to transform a bulk set of data from one record to another. During the course of this transfer, it is expected that we will have errors on the records in the system. ...
2
votes
0answers
117 views

Delete __Sharing object

I'm receiving the following error: TR09_MasterServiceAgreement: execution of AfterInsert caused by: System.DmlException: Delete failed. First exception on row 0 with id 02c1800002Lir2PAAR; ...
0
votes
1answer
30 views

How to catch update exception and what kind of notification to do here?

I have a trigger with helper class and test. But I don't know how to test update there and what kind of notification I need. Thanks for any help. Trigger: trigger ArchivedTrigger on Item__c (after ...
0
votes
3answers
123 views

Test Coverage in Select DML Exception

How can we throw DML exceptions in Batch Start method in apex? I want to cover a code using test class which handles dml exception in select query in batch start method. Query is simple select query ...
5
votes
2answers
188 views

Custom Logging, @Future, Transaction Control

I have a similar question to these two: Custom Logging and Future Methods Custom Exception Handling & Logging But my question this time is: can I put the @Future annotation on the Logger Class? ...
1
vote
1answer
37 views

Throwing a CalloutException for Aura Controller

I have an aura controller which calls a Services class. This services class makes a callout to external system and returns a response. public class Anauracontroller{ public resObj callService(){ ...
5
votes
1answer
332 views

Exceptions and DML

It was to my understanding that when you throw an exception all previous operations are rolled back. When an exception occurs, code execution halts and any DML operations that were processed ...
2
votes
1answer
19 views

Will remaining scheduled action fail if an earlier scheduled action fails?

Based on the process below: If the 4th scheduled action throws an exception, will the 5th scheduled action still fire later?
1
vote
1answer
60 views

How to increase code coverage for catch block

I have below Apex class (DAO class) which has a try-catch block. Same try-catch block has been used in 5 different methods. I tried sending setOpportunityId as account id or null id but still, it is ...
0
votes
2answers
47 views

SObject row was retrieved via SOQL without querying the requested field: Campaign_Design_Profile__c.Related_Opportunity_ID__c

I need help troubleshooting the below apex. I have this class being called in a custom JSON Builder on a custom object. I'm logging successful runs in the log in the developer console, but in the ...
0
votes
1answer
43 views

Beautify exceptions from triggers in Lightning UI

I have a function that I fire on an after insert or update of my Inventory__c object public class duplicateException extends Exception {} public static void preventDuplication (List<Inventory__c&...
0
votes
2answers
262 views

Cannot Read Property 'getList' of Null Exception

I have a component which iterates over a list of records and in turn calls a child component for each record returned. This works fine. I also have a lightning:slider in a seperate component which ...
2
votes
2answers
218 views

Not Receiving Unhandled Exceptions Emails

I had have a very minimal code to throw null pointer exception intentionally. The reason was we're not receiving exception emails. We even reached out to support(You know how it can be painful process)...
0
votes
1answer
81 views

Issues in Scheduled Apex

Error:First error: Delete failed. First exception on row 0 with id a2A0R000003T2DMUA0; first error: ENTITY_IS_DELETED, entity is deleted: [] Note: Above error occurs to me as a concurrency Issue. ...
0
votes
1answer
39 views

Attempt to de-reference null object (Custom File Import)

The requirement is to import a tab separated text file and updated the records matching with some statuses then display success to for failure with the list of records. I wrote the following VF and ...
2
votes
1answer
90 views

How to enforce CRUD and FLS in bulk trigger?

How to enforce CRUD and FLS in following situation (bulk trigger). Better idea is simply throw an exception or addError(errMsg) ? trigger CaseCommentTrigger on CaseComment (after insert) { List<...
5
votes
1answer
219 views

Not able to catch an exception (Custom + Standard) from trigger

Please consider the below scenario: I have an Application__c object. I have a trigger on that (for simplicity, coded directly in trigger) which does one thing if the record name is Error then throws ...
0
votes
1answer
44 views

How to resolve below Dataloader error

Too many retries of batch save in the presence of Apex triggers with failures: when triggers are present partial save requires that some subset of rows save without any errors in order to avoid ...
-2
votes
2answers
68 views

Null pointer Exception in Apex controller

I am getting "FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object" in Apex controller when i click on update link pop up. Its showing in query with " ulstAsset ".I am newbie ...
0
votes
1answer
87 views

How to tell which Validation / Workflow rule caused exception?

I am using a batch class to mass change the case owner from one queue to another, but during the update process I am returned the following exception: FATAL_ERROR System.DmlException: Update failed. ...
0
votes
0answers
79 views

RunTime exception for Converting String to Boolean

Public static void createDiscrepancy(Id ndcId,Map<object,String> mapOfParameters){ try { ...
2
votes
0answers
298 views

Not receiving Apex exception emails

I am unable to receive any Apex exception emails in both my own dev playground org and the sandboxes/production org for the company I work for. I remember at my last company I would receive exception ...
2
votes
2answers
189 views

Getting the row culprit of an insertion failure [closed]

Sometimes some of my orders and contracts are not define in the same date terms. That causes my system to throw an exception as follows: Message: Insert failed. First exception on row 8; first ...
0
votes
0answers
34 views

Throwing Custom Exceptions From Post Install Script

We have created a post-installation script for a Managed Package. As we are using lightning components in my package, the domain must be enabled. In post-installation script, we are checking whether ...
0
votes
1answer
39 views

Out-of-the-box way of storing exceptions caught in a lightning component

Normally, we want to catch apex-side exceptions and throw it gracefully to the lightning component. But my requirement is to catch errors/unhandled scenarios in the lightning component and store those ...