Skip to main content

Questions tagged [exception]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Fatal exception java.lang.IncompatibleClassChangeError with MarketingCloudSdk 8.1.5 for Android

I recently upgraded and Android app to compileSdk 34 and updated MarketingCloudSdk to 8.1.5 For some phones (eg. Galaxy Note 10) I have this exception at start up: Fatal Exception: java....
Alberto Cappellina's user avatar
0 votes
0 answers
16 views

Displaying message on terminated session device and redirect to community login page

We have a login flow in our community. If a second user logs in with a user that is already logged in, it terminates the old session and continues with the new one. There is no issue with terminating ...
ozanozaydemir's user avatar
-1 votes
0 answers
29 views

Catch [UNKNOWN_EXCEPTION]java.net.SocketTimeoutException: Read timed out in apex

Recently i came across an error [UNKNOWN EXCEPTION]java.net.SocketTimeoutException: Read timed out while access a external url using page reference in apex. The problem which we are facing is with ...
Ranjit Mishra's user avatar
2 votes
1 answer
74 views

How expensive is throwing an Exception ? (I want a stack trace for non-exception conditions)

One way to get a hold of the current stack trace at any given point is to purposely throw an exception, catch it immediately, and inspect the trace information. I keep reading about the expense of ...
Eric Whipple's user avatar
1 vote
0 answers
67 views

Can we override the System defined Exception message using the Custom Exception Handling?

I have tried to handle the system defined Exception using the Custom Exception in Apex but only the message part gets overriden. Is there any chance that we can override the entire system defined ...
Sai's user avatar
  • 11
-2 votes
1 answer
47 views

SObject was retrieved without querying error not raised as expected

Generally, if a field is not retrieved from SOQL and is used in code later, it raises the well known exception " SObjecte row was retrieved without querying field...". However, this behavior ...
Sarang's user avatar
  • 2,618
0 votes
1 answer
45 views

DMLEXCEPTION NOT BEING CAUGHT

I HAVE WRITTEN THE BELOW CODE BUT IT IS NOT THROWING THE MIXEDDMLEXCEPTION AND I DON'T UNDERSTAND WHY. public class April22Task2 { public static void createUserAndAccount() { //...
Md Talib's user avatar
1 vote
0 answers
30 views

I need simulate an exception for a test

I have a problem making a testclass. I need to simulate an exception for this class: public class ScheduleOmniAlta50 implements Queueable, Database.AllowsCallouts { private String body; ...
Gonzalo's user avatar
  • 15
0 votes
1 answer
53 views

System.QueryException: Record Currently Unavailable

Im getting the following error: caused by: System.QueryException: Record Currently Unavailable: The record you are attempting to edit, or one of its related records, is currently being modified by ...
Thomas's user avatar
  • 2,310
0 votes
0 answers
109 views

Not allowed to install or modify metadata via Apex

I know that this error is a hot topic and case for Salesforce but I tried to bypass this using some code workaround. Here is the code that I tried: // Upsert method call try { ...
batuayyildiz's user avatar
-3 votes
1 answer
77 views

System.FinalException: SObject row does not allow errors on Batch

i am trying to create a batch that prevent from creating duplicate records. This is my classes and trigger Class batchCheckDoublonContact : global class batchCheckDoublonContact implements Database....
Amir Bouzid's user avatar
0 votes
0 answers
24 views

Throw DmlException and getDmlMessage [duplicate]

I need to throw DMLException and get message via getDmlMessage. But it gives me error for any message of DMLException on getDmlMessage. And I can't find any code about constructor parameters. Ide ...
kerada's user avatar
  • 1
-1 votes
1 answer
42 views

Validation Rule Conflicting with Process builder

I have this validation rule which locks the field of opportunity when its closedwon/lost. But it is not working as it is conflicting with a flows(which updates closewon/lost dates as today() ) saying ...
Rajdeep Baghel's user avatar
3 votes
0 answers
119 views

Platform Events - setResumeCheckpoint method is not working as expected after throwing an EventBus.RetryableException

We have a Platform events framework that takes the responsibility of processing a batch of n incoming platform events. This framework was working fine until around one/two months ago when we realized ...
Alvhix's user avatar
  • 71
0 votes
1 answer
202 views

'uncommitted work pending' even when all DML statements have been deactivated

Our system is pretty complex with DML statements, call-outs and future methods everywhere. After adding some more functionality, I ran into the dreaded 'uncommitted work pending' error. It had been a ...
Sander de Jong's user avatar
0 votes
0 answers
100 views

Trying to find objects that are capturing the row lock, bulk data load jobs, failed flows, etc

I'm trying to monitor the below issues. Could someone please help us to get insights on which object the below information gets captured. Row lock errors/issues Bulk Data load Jos errors/issues Audit ...
Bforce's user avatar
  • 6,838
0 votes
1 answer
649 views

Apex is throwing error but LWC is not catching and displaying the correct Toast message

I have created a validation rule on Order Product Object, it is working as expected on the record page. While making changes from LWC, error message is not shown, instead a success message is showing ...
Shashwat Chaturvedi's user avatar
-1 votes
1 answer
303 views

Can AuraHandledExceptions appear on an Aura component without being processed by an action callback function?

I have a custom error page that should appear every time an error appears from the middle/back end. I have an Aura component that is using this. This Aura component has 4 actions that call its Apex ...
seekingPeace's user avatar
-2 votes
1 answer
166 views

Exceptions on Client side Aura,LWC [closed]

What are types of exceptions on client side in Aura, Lightning Web Components?
Prathyusha's user avatar
0 votes
2 answers
437 views

Is DmlException is enough to catch all exceptions once wrapped for DML operation?

If we are using try catch only on DML operation part, where on catch block if only DmlException is used, then would it be enough to handle all possible errors occurs there or we also need to use ...
ItsVicky's user avatar
1 vote
0 answers
183 views

How to handle DML exceptions in apex class WITH USER_MODE?

I'm trying to do a DML with user mode in apiVersion 58.0. I got "DML Exception" while inserting records without field permission and I got "SecurityException" while inserting ...
Senthil Kumar's user avatar
0 votes
1 answer
229 views

Throw Exception still remains 'SUCCESS' state in aura component

My aura component still retrieve a response with 'SUCCESS' state even though I threw Exception. My aura component's controller handleApproval: { var recordId = cmp.get("v.recordId"); var ...
Tuấn Trần quốc's user avatar
0 votes
0 answers
178 views

How to create reusable LWC to handle exceptions in JS?

I have created a reusable LWC JS file lwcExceptionLogging.js const lwcException = (err) => { console.log(err.name+'--Name'); var name = err.name; console.log('log Name--'+name); } export {...
Prathyusha's user avatar
2 votes
1 answer
3k views

Problem getting consistent error stack trace in LWC

I am trying to capture an error thrown from Apex in my LWC promise chain, with an end goal to publish a Slack message with the error details. The slack message template contains the following needed ...
Lucas Santanna's user avatar
0 votes
1 answer
200 views

Custom exception maximum message length?

What is the maximum length of the message of a custom exception? class CustomException extends Exception{} public static void throwException(){ String message = 'lots of text........'; if(...
fred's user avatar
  • 3,414
0 votes
1 answer
155 views

How to insert related record when DUPLICATES_DETECTED error is thrown from Salesforce Matching Rule?

I have a requirement to insert CampaignMembers whenever a duplicate Lead is identified. The duplicate check for all Leads of all Lead sources is handled via Standard Duplicate rule. This rule needs to ...
Apex Srinivas's user avatar
0 votes
1 answer
34 views

I want to show error msg, If user has no access for CustomPermission named "deleteFileAccess"

The method is @AuraEnabled public static void deleteSelectedFiles(List<String> contentDocumentIds) { try { if (!contentDocumentIds.isEmpty() && contentDocumentIds != null) { ...
Santosh P's user avatar
3 votes
1 answer
216 views

Trigger.isBefore throwing a NPE in if statement

I ran the following code in anonymous apex: System.debug('Value of Trigger.isBefore: ' + Trigger.isBefore); if (Trigger.isBefore) { System.debug('In is before trigger.'); } Line 1 prints: "...
Arthlete's user avatar
  • 4,957
-1 votes
2 answers
171 views

Bulk update of custom field value in salesforce object failing due to custom validations and triggers

I added a custom field to opportunity salesforce object. It's name is externalId__c. The field is added to the object. However when I am trying to update the value of externalId__c for all the records,...
Chitvan Mishra's user avatar
0 votes
0 answers
35 views

GACK Response Closing a Case and get an Unknown Exception Code

We are trying to close a case that was reopened and then when we go to close it again, we get the following error message. We recently went through the Spring Update 2023 and wondering if there is a ...
jeffrose2utah's user avatar
-1 votes
1 answer
329 views

Help with "FIELD_CUSTOM_VALIDATION_EXCEPTION" Batch class failed to update records

I have a similar batch class and the problem is not with the logic. public class SimpleBatch implements Database.Batchable{ public Database.QueryLocator start(Database.BatchableContext BC){ return ...
sangeetha balasubramanian's user avatar
0 votes
1 answer
441 views

How to write testclass for custom exception

How do you write test class if the exception has been thrown public class UserService{ public class UserServiceException extends Exception{} public static Contact createUser(...
Shugi Yen's user avatar
1 vote
1 answer
384 views

Internal Salesforce.com Error on CUMULATIVE_LIMIT_USAGE or LIMIT_USAGE_FOR_NS

Issue: I'm experiencing a Fatal Error - Internal Salesforce.com Error while running a query that could be possibly be returning a huge number or records. Any thoughts on how to resolve this? ...
Cephas's user avatar
  • 11
1 vote
2 answers
365 views

How to address null-pointer exception

I Have the following apex code which is throwing a nullpointer exception on the line: points = points + value; List<JMG_ExternalSearch__c> searchList = [SELECT Id,LastModifiedDate,...
Thomas's user avatar
  • 2,310
0 votes
1 answer
138 views

Fetching information like login time, checking from Sales cloud in Marketing cloud using SSJS

I was able to use the below code in one environment and I am getting the expected results. When I am trying to run the same (I did modify necessary things like change in DE external key, network ID ...
Roma's user avatar
  • 1
0 votes
0 answers
552 views

How to catch exception for "Can only throw this exception type from VisualForce or Aura context"

I have an apex class that does not interact with Aura. Sometimes I get the error "Can only throw this exception type from VisualForce or Aura context". I'm looking to see if I can catch that ...
DigitalWoman's user avatar
-2 votes
1 answer
179 views

Show exception message in lightning without stacktrace APEX?

I want to show a duplicateRule message Error without showing stacktrace and the line of my code where the error is. I tried with this : public class applicationException extends Exception {} ...
Ach Jiren's user avatar
1 vote
0 answers
159 views

Two Post Install Exceptions occurred while installing Health Cloud

We are installing Health Cloud into a new, clean org. The pre-installation steps were carried out prior to the installation, ie Chatter enabled, Contact to multiple Accounts, etc. After the ...
Andrew's user avatar
  • 11
0 votes
1 answer
361 views

Prevent DML rollback when custom exception is thrown

In our org we are calling batches from an external system using salesforce API. When a batch is failing the external system create a bug and it goes into our standard processes. A new requirement has ...
Julien Souchi's user avatar
1 vote
1 answer
908 views

Throw exception, Insert Log error and send mail in same time in APEX

in apex, can it be handled so that when the program runs an error and the catch fires an exception, can this exception do 3 things at the same time? (I used platform events and it only gives 1 and 2 ...
David's user avatar
  • 13
-1 votes
1 answer
137 views

How to get CPU consumed by each Apex [closed]

I am trying to find some way to build an application/report which shows CPU time consumed by each class per execute. Please refer below table to get more details of the ask. APEX Class Consumed CPU ...
Mehul's user avatar
  • 1
1 vote
0 answers
250 views

"ExecutionException: List index out of bounds: 0" while sending email from Apex using email template with Custom Object merged fields

Here is the code- public static void sendEmailToUser(String email, String emailTemplateNameText, String selectedRecordId){ String emailTemplateName = '%' + emailTemplateNameText + '%'; ...
Prapti's user avatar
  • 45
3 votes
1 answer
541 views

Why does this assertion fail when comparing exceptions?

I have a test method that asserts an expected exception equals the thrown exception but it fails, but the error message says they are the same @IsTest private static void isThrowable() { // given ...
TemporaryFix's user avatar
  • 2,946
0 votes
1 answer
328 views

should exception's inner class be public or private

Scenario: I have 1 APEX class, in which I have inner class extending exception, as can be seen below: public with sharing class ClassA{ PUBLIC/PRIVATE class ClassBException extends ClassCException {...
user43598's user avatar
  • 517
0 votes
0 answers
428 views

Exception "Exception occurred in direct soap call" while trying to save changes in an Einstein Bot

I get the following exception with Bots: "ui.services.connection.api.ToolingConnectionException: com.sforce.ws.ConnectionException: Exception occurred in direct soap call". It happens in the ...
Aylen's user avatar
  • 11
0 votes
2 answers
653 views

On updating, it shows System.ListException: Duplicate id in list: 0015j00000eFggSAAS

I am having this exception on after update trigger on updating any MailingState field of contact object. I want to update the value of Contact's 'MailingState' field to the Account's 'BillingState' ...
Devesh's user avatar
  • 1
0 votes
1 answer
138 views

Attempt to de-reference a null object when throwing a custom exception

I have created a custom Exception class public class StatusException extends Exception{}; when using it to throw an error it's throwing a null pointer exception too. public class ContainerSync2 { ...
Mridul Kapil's user avatar
1 vote
0 answers
232 views

UNABLE_TO_LOCK_ROW too soon

According to Salesforce's documentation a transaction can wait for up to 10 seconds before throwing an exception with the code "UNABLE_TO_LOCK_ROW". Yet I get the following scenario: ...
alozzi's user avatar
  • 11
0 votes
0 answers
264 views

Email deliverability is off but still receiving Apex Exception emails - is this expected?

The Email Deliverability setting is off. As per the doc, all outbound emails to and from users are stopped. What I'm perplexed about is that I am still receiving some Apex Unhandled Exception emails. ...
Andy Hitchings's user avatar
-1 votes
1 answer
429 views

I am unable to insert 10000 records. Getting Too man query rows error

public class CreateBulkAccounts { @future Public static void method1() { List<Account> acList = new List<Account>(); for(integer i=0; i<10000; i++) ...
narojoc807's user avatar

1
2 3 4 5
12