diff --git a/src/map/location.cpp b/src/map/location.cpp index f5b0e78709d..4b287f0c0e2 100644 --- a/src/map/location.cpp +++ b/src/map/location.cpp @@ -451,7 +451,7 @@ void read_locations(const config& cfg, std::vector& locs) const std::vector yvals = utils::split(cfg["y"]); if (xvals.size() != yvals.size()) { - throw bad_lexical_cast(); + throw std::invalid_argument("Number of x and y coordinates do not match."); } std::transform(xvals.begin(), xvals.end(), yvals.begin(), std::back_inserter(locs), &read_locations_helper); diff --git a/src/synced_commands.cpp b/src/synced_commands.cpp index 58ab6ff5043..e1068074672 100644 --- a/src/synced_commands.cpp +++ b/src/synced_commands.cpp @@ -261,7 +261,7 @@ SYNCED_COMMAND_HANDLER_FUNCTION(move, child, use_undo, show, error_handler) try { read_locations(child,steps); - } catch (bad_lexical_cast &) { + } catch (std::invalid_argument&) { WRN_REPLAY << "Warning: Path data contained something which could not be parsed to a sequence of locations:" << "\n config = " << child.debug() << std::endl; return false; }