mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-07-06 20:57:46 +00:00
handle bad json in exd_struct_gen
This commit is contained in:
parent
95905cd9cf
commit
1b3aac4468
1 changed files with 11 additions and 2 deletions
|
@ -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" ] )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue