mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 20:40:27 +00:00
hd-rum-transcode: catch stoi invalid_argument
Make something like `hd-rum-transcode 8M 5004 -P x 100::1` fail with humaan readable message.
This commit is contained in:
@@ -1016,6 +1016,13 @@ int main(int argc, char **argv)
|
||||
int ret = -1;
|
||||
try {
|
||||
ret = parse_fmt(argc, argv, ¶ms);
|
||||
} catch (invalid_argument &e) {
|
||||
if (strcmp(e.what(), "stoi") != 0 &&
|
||||
strcmp(e.what(), "stod") != 0) {
|
||||
throw;
|
||||
}
|
||||
MSG(ERROR, "Non-numeric value passed to option "
|
||||
"expecting a number!\n");
|
||||
} catch (ug_runtime_error &e) {
|
||||
MSG(FATAL, "%s\n", e.what());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user