Skip to content

Replace CopyResult with exceptions? #243

@tkoolen

Description

@tkoolen

I find CopyResult a little cumbersome to work with.

If you call a bunch of functions that could fail in some circumstances in your copy! method, they all have to return a CopyResult in addition to their normal output arguments, and then in copy! itself you have to continually check whether those subfunctions returned a non-Success CopyResult.

Less importantly, it's also annoying that you need to pass in a dud index map when you're about to return a bad CopyResult, even though the index map is useless since it maps to nothing.

Why not just have some documented Exception subtypes in MOI and require that those be thrown if something goes wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions