I'm stuck at this error "Future methods do not support parameter type of Exception". Is there any workaround for this error?
As @DavidReed mentions, future methods can only support primitive types and collections of primitive types. If you want to still pass in Exception classes or more complicated classes, use Queueable instead, which behaves almost exactly like future methods, but supports more complicated data types.
This is part and parcel of the standard limitations on future methods:
The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types. Methods with the future annotation cannot take sObjects or objects as arguments.
You can pass an exception's message (
e.getMessage()) to a future method, because it's a String, and String is a primitive type in Apex. Exceptions are not; they're objects. They also cannot be serialized to JSON, so you're stuck passing the exception's attributes to your future method.