1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Throwing runtime_errors instead of string (or even char*) objects.

This commit is contained in:
Michał W. Urbańczyk
2012-04-22 07:32:45 +00:00
parent 9c770777fb
commit 017013a5a4
20 changed files with 31 additions and 31 deletions

View File

@@ -110,7 +110,7 @@ PlayerStatus PlayerStatuses::operator[](ui8 player)
}
else
{
throw std::string("No such player!");
throw std::runtime_error("No such player!");
}
}
void PlayerStatuses::addPlayer(ui8 player)
@@ -141,7 +141,7 @@ bool PlayerStatuses::checkFlag(ui8 player, bool PlayerStatus::*flag)
}
else
{
throw std::string("No such player!");
throw std::runtime_error("No such player!");
}
}
void PlayerStatuses::setFlag(ui8 player, bool PlayerStatus::*flag, bool val)
@@ -153,7 +153,7 @@ void PlayerStatuses::setFlag(ui8 player, bool PlayerStatus::*flag, bool val)
}
else
{
throw std::string("No such player!");
throw std::runtime_error("No such player!");
}
cv.notify_all();
}
@@ -166,7 +166,7 @@ void PlayerStatuses::addQuery(ui8 player, ui32 id)
}
else
{
throw std::string("No such player!");
throw std::runtime_error("No such player!");
}
cv.notify_all();
}
@@ -179,7 +179,7 @@ void PlayerStatuses::removeQuery(ui8 player, ui32 id)
}
else
{
throw std::string("No such player!");
throw std::runtime_error("No such player!");
}
cv.notify_all();
}