Переглянути джерело

Improve IllegalArithmeticOperationException usage in project classes

Patrick-Christopher Mattulat 1 рік тому
батько
коміт
a88d260a60
2 змінених файлів з 10 додано та 10 видалено
  1. 5 5
      source/ls-std/boxing/Integer.cpp
  2. 5 5
      source/ls-std/boxing/Long.cpp

+ 5 - 5
source/ls-std/boxing/Integer.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2023-02-04
+ * Changed:         2023-02-07
  *
  * */
 
@@ -68,7 +68,7 @@ int ls::std::boxing::Integer::operator/(const ls::std::boxing::Integer &_integer
 {
   if (_integer == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   return this->value / _integer;
@@ -78,7 +78,7 @@ int ls::std::boxing::Integer::operator/(int _value) const
 {
   if (_value == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   return this->value / _value;
@@ -134,7 +134,7 @@ ls::std::boxing::Integer &ls::std::boxing::Integer::operator/=(const ls::std::bo
 {
   if (_integer == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   this->value /= _integer;
@@ -145,7 +145,7 @@ ls::std::boxing::Integer &ls::std::boxing::Integer::operator/=(int _value)
 {
   if (_value == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   this->value /= _value;

+ 5 - 5
source/ls-std/boxing/Long.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2023-02-04
+ * Changed:         2023-02-07
  *
  * */
 
@@ -68,7 +68,7 @@ ls::std::core::type::long_type ls::std::boxing::Long::operator/(const ls::std::b
 {
   if (_long == (ls::std::core::type::long_type) 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   return this->value / _long;
@@ -78,7 +78,7 @@ ls::std::core::type::long_type ls::std::boxing::Long::operator/(ls::std::core::t
 {
   if (_value == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   return this->value / _value;
@@ -134,7 +134,7 @@ ls::std::boxing::Long &ls::std::boxing::Long::operator/=(const ls::std::boxing::
 {
   if (_long == (ls::std::core::type::long_type) 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   this->value /= _long;
@@ -145,7 +145,7 @@ ls::std::boxing::Long &ls::std::boxing::Long::operator/=(ls::std::core::type::lo
 {
   if (_value == 0)
   {
-    throw ls::std::core::IllegalArithmeticOperationException{};
+    throw ls::std::core::IllegalArithmeticOperationException{"division by zero is not allowed"};
   }
 
   this->value /= _value;