Feature Overview
This feature catches any exception thrown from the method and rethrows the wrapped exception.
This feature catches any exception thrown from the method and rethrows the wrapped exception.
None
public class Rethrow {
@AuraEnabled
@rethrow(AuraHandledException)
public static void test() {
System.debug('Rethrow exceptions');
}
}
public class Rethrow {
@AuraEnabled
public static void test() {
try {
System.debug('Rethrow exceptions');
}
catch(Exception e) {
System.debug(LoggingLevel.Error, e.getStackTraceString());
throw new AuraHandledException(e.getMessage());
}
}
}
@rethrow
can only be used on methods.
Contribute on Github! Edit this section.