Skip to content

Bunched CanThrows #23481

Open
Open
@odersky

Description

@odersky

One problem with the saferException scheme is that so far each CanThrow capability has to be passed separately. It's not yet possible to bunch several exceptions in a single CanThrow capability.

It looks like we could use dependency injection scheme explained here and here to aggregate CanThrow. Using this scheme, a capability to enable throwing an IOException and an SQLExcecption would be

  CanThrow[(IoException, SQLException)]

The discussion on dependency injection shows why & would not work for aggregating exceptions (it would lead to given search ambiguities) but tupling is a good alternative.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions