maint(fastfiles): better error handling
This commit is contained in:
parent
e60f987fff
commit
568ab4ee92
@ -108,14 +108,24 @@ public:
|
||||
{
|
||||
console::info("%d %s\n", i, game::native::g_assetNames[i]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
int type;
|
||||
try
|
||||
{
|
||||
const auto type = std::strtol(params.get(1), nullptr, 0);
|
||||
type = std::stoi(params.get(1), nullptr, 0);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
console::error("Invalid pool passed. Got: %s, causing error: %s\n", params.get(1), ex.what());
|
||||
return;
|
||||
}
|
||||
|
||||
if (type < 0 || type >= game::native::ASSET_TYPE_COUNT)
|
||||
{
|
||||
console::error("Invalid pool passed must be between [%d, %d]\n", 0, game::native::ASSET_TYPE_COUNT - 1);
|
||||
console::error("Invalid pool number passed, must be between [%d, %d]\n", 0, game::native::ASSET_TYPE_COUNT - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -134,7 +144,6 @@ public:
|
||||
|
||||
console::info("%s\n", asset_name);
|
||||
}, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user