Skip to content

Refactored VCardFormatError into subclasses

Victor Engmark requested to merge Zearin:refactor/error_types into master

Created by: Zearin

  • VCardFormatError renamed to VCardError
  • Error Subclasses for Names, Values, and ItemCount

Dunno what you’ll think of this one, @L0b0, but I thought some error types which describe more specific types of VCard errors would be helpful for the end-user.

The classes VCardNameError and VCardValueError are a nice parallel to the standard library exceptions NameError and ValueError (although they only inherit from VCardError).

The class VCardItemCountError is vaguely like the standard library IndexError, in that both are raised when an expected number of something is out of bounds.

Finally, there’s the VCardLineError class, whose name makes it pretty obvious what went wrong. :)

Merge request reports