Designing exceptions for conversion failures
- by Mr.C64
Suppose there are some methods to convert from "X" to "Y" and vice versa; the conversion may fail in some cases, and exceptions are used to signal conversion errors in those cases.
Which would be the best option for defining exception classes in this context?
A single XYConversionException class, with an attribute (e.g. an
enum) specifying the…