Skip to content

Add support for Kotlin's Result #3558

Open
@GSala

Description

@GSala

Now that inline classes are stable in Kotlin 1.5.0, it would be nice to have API endpoints return Result to wrap the outcome (success/failure) of a retrofit call, instead of returning a value or throwing an exception.

For example:

@GET("me")
suspend fun getUser(): Result<User>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions