convertToResult
Wraps a passed data (or) error into appropriate Result object. Note: Only one param is expected to be passed.
Parameters
data
, the data that is wrapped as Result.Success.value
error
, the error-data that is wrapped as Result.Failure.value