[util/hb-subset] Print error and suggest filing github issue if operation fails

https://github.com/harfbuzz/harfbuzz/issues/3173#issuecomment-906715780
This commit is contained in:
Behdad Esfahbod 2021-08-29 09:44:52 -06:00
parent 38ad093216
commit fdce294120
2 changed files with 6 additions and 3 deletions

View File

@ -66,7 +66,10 @@ batch_main (int argc, char **argv)
return ret; return ret;
} }
return main_t () (argc, argv); int ret = main_t () (argc, argv);
if (report_status && ret != 0)
fprintf (stdout, "error: Operation failed. Probably a bug. File github issue.\n");
return ret;
} }
#endif #endif

View File

@ -108,7 +108,7 @@ struct shape_options_t
if (!hb_shape_full (font, buffer, features, num_features, shapers)) if (!hb_shape_full (font, buffer, features, num_features, shapers))
{ {
if (error) if (error)
*error = "all shapers failed."; *error = "All shapers failed.";
goto fail; goto fail;
} }
@ -246,7 +246,7 @@ struct shape_options_t
if (!hb_shape_full (font, fragment, features, num_features, shapers)) if (!hb_shape_full (font, fragment, features, num_features, shapers))
{ {
if (error) if (error)
*error = "all shapers failed while shaping fragment."; *error = "All shapers failed while shaping fragment.";
hb_buffer_destroy (reconstruction); hb_buffer_destroy (reconstruction);
hb_buffer_destroy (fragment); hb_buffer_destroy (fragment);
return false; return false;