I'm not an expert in java's type system and exception handling. But i found in SO that we should only catch exceptions but not throwable's.
Here is the link: Difference between using Throwable and Exception in a try catch
In Vavr's library i found this source code:
public interface Try<T> extends Value<T>, Serializable {
long serialVersionUID = 1L;
static <T> Try<T> of(CheckedFunction0<? extends T> supplier) {
Objects.requireNonNull(supplier, "supplier is null");
try {
return new Try.Success(supplier.apply());
} catch (Throwable var2) {
return new Try.Failure(var2);
}
}
}
Would i have any issues in future if i will use this container? Will i miss some critical exceptions that may occur during execution of 'of' function?