1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

handle bad json in exd_struct_gen

This commit is contained in:
NotAdam 2019-10-29 18:49:27 +11:00
parent 39fc43a27a
commit 23aad09227

View file

@ -127,8 +127,17 @@ std::string generateStruct( const std::string& exd )
}
auto sheet = nlohmann::json();
std::ifstream defJson( path );
defJson >> sheet;
try
{
std::ifstream defJson( path );
defJson >> sheet;
}
catch( const std::exception& ex )
{
Logger::error( "Failed parsing json definition, err: {} file: {}", ex.what(), path );
return "";
}
for( auto& definition : sheet[ "definitions" ] )
{