driver-core/src/main/com/mongodb/MongoException.java
@Nullable
    public static MongoException fromThrowable(@Nullable final Throwable t) {
        if (t == null) {
            return null;
        } else {
            return fromThrowableNonNull(t);
        }
    }
@Nullable
    public static MongoException fromThrowable(@Nullable final Throwable t) {
        if (t == null) {
            return null;
        } else {
            return fromThrowableNonNull(t);
        }
    }
Static helper to create or cast a MongoException from a throwable

@param t a throwable, which may be null
@return a MongoException