[util/generic/yexception.h] Added TBadArgumentException and made TBadCastException inherited from it
@@ -121,7 +121,18 @@ class TIoSystemError: public TSystemError, public TIoException {
class TFileError: public TIoSystemError {
};
-struct TBadCastException: public virtual yexception {
+// TBadArgumentException should be thrown when an argument supplied to some function (or constructor)
+// is invalid or incorrect.
+//
+// NOTE: a special case when such argument is given to a function which performs type casting
+// (e.g. integer from string) is covered by the TBadCastException class which is derived from
+// TBadArgumentException.
+struct TBadArgumentException: public virtual yexception {
+};
+
+// TBadCastException should be thrown to indicate the failure of some type casting procedure
+// (e.g. reading an integer parameter from string).
+struct TBadCastException: public virtual TBadArgumentException {
};
#define ythrow throw __LOCATION__ +
