wrapIfNeeded static method

FException wrapIfNeeded(
  1. Object likeError, [
  2. StackTrace? stackTrace
])

Implementation

static FException wrapIfNeeded(Object likeError, [StackTrace? stackTrace]) {
  if (likeError is FException) {
    return likeError;
  } else if (likeError is Error) {
    return FExceptionNativeErrorWrapper(likeError);
  } else if (likeError is Exception) {
    return FExceptionNativeExceptionWrapper(likeError);
  } else {
    return FExceptionNativeObjectWrapper(likeError);
  }
}