Skip to content

Requesting throwing alternative to body() #273

Open
@bjo0

Description

@bjo0

The signature for body() is:

func body() -> Element?

It would improve ergonomics if there was a version of this that threw, e.g.:

func body() throws -> Element

This would allow for better ergonomics at call sites that propagate errors, while not really diminishing the ergonomics for sites that want to deal in optionals, as try? is always available.

It wasn't immediately clear to me if try document.select("body") is an appropriate alternative for getting a throwing version of this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions