Skip to content

Hard to distinguish errors from reference_create #828

Closed
@robinst

Description

@robinst

When creating a branch, there are multiple error cases that are interesting:

  • Branch already exists
  • Branch name was invalid

Currently, reference_create maps both of these errors to ValueError. The message is different, but distinguishing based on the message is fragile.

What do you think about introducing two new exceptions types (subclasses of ValueError for backward compatibility) that allow callers to distinguish the errors?

I'm happy to raise a PR if that sounds good!

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