hardCause method
Returns the first cause which, recursively, is NOT a UserException. If not found, returns null.
Implementation
Object? hardCause() {
if (cause is UserException)
return (cause as UserException).hardCause();
else
return cause;
}