Improved error message when 'Part' is missing in theme file

0.8
Bruno Van de Velde 2015-09-08 02:23:51 +02:00
parent ffe014140c
commit 2d668949f3
1 changed files with 6 additions and 1 deletions

View File

@ -298,7 +298,12 @@ namespace tgui
std::advance(c, 6);
}
else
throw tgui::Exception{"Failed to deserialize texture '" + value + "'. Unexpected word '" + word + "' in front of opening bracket."};
{
if (word.empty())
throw tgui::Exception{"Failed to deserialize texture '" + value + "'. Expected 'Part' or 'Middle' in front of opening bracket."};
else
throw tgui::Exception{"Failed to deserialize texture '" + value + "'. Unexpected word '" + word + "' in front of opening bracket. Expected 'Part' or 'Middle'."};
}
auto closeBracketPos = value.find(')', c - value.begin());
if (closeBracketPos != std::string::npos)