From: Alan T. DeKok Date: Mon, 18 Aug 2025 12:19:23 +0000 (-0400) Subject: clearer error messages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a161add0008764e3f8dd748fee527ac256b60b2d;p=thirdparty%2Ffreeradius-server.git clearer error messages --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 3d9a4d0478b..ec199a948a3 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -3278,7 +3278,15 @@ static int _dict_from_file(dict_tokenize_ctx_t *dctx, if (argc == 0) continue; if (argc == 1) { - fr_strerror_const("Invalid syntax - expected keyword followed by arguments"); + /* + * Be nice. + */ + if ((strcmp(argv[0], "BEGIN") == 0) || + (fr_dict_keyword(&parser, keywords, NUM_ELEMENTS(keywords), argv_p[0], NULL))) { + fr_strerror_printf("Keyword %s is missing all of its arguments", argv[0]); + } else { + fr_strerror_printf("Invalid syntax - unknown keyword %s", argv[0]); + } error: fr_strerror_printf_push("Failed parsing dictionary at %s[%d]", fr_cwd_strip(fn), line);