Bug #2704
closedSlight improvement to the message format on duplicate array kes
Description
I accidentally had the same file extension twice, such as:
".md" => "text/plain",
".md" => "text/plain",
As part of mimetype.assign.
I got this error:
"Duplicate array-key: .md
2016-01-01 00:25:48: (configfile.c.957) source: /serve/lighttpd.conf line: 168 pos: 9 parser failed somehow near here: (COMMA) "
I assume that you want to retain this as an error, so people have to fix it before, rather than lighttpd e. g. using
the last definition.
I do suggest to slightly modify the error message though.
Rather than:
"parser failed somehow near here"
To write something such as:
"duplicate array-key: .md detected. It is recommended to get rid of the duplicate entry."
Thanks.
Updated by gstrauss almost 9 years ago
Trivial request.
@stbuehler: can the error message be slightly extended?
diff --git a/src/configparser.y b/src/configparser.y index b22dac1..0136e71 100644 --- a/src/configparser.y +++ b/src/configparser.y @@ -297,7 +297,8 @@ aelements(A) ::= aelements(C) COMMA aelement(B). { array_insert_unique(C, B); B = NULL; } else { - fprintf(stderr, "Duplicate array-key: %s\n", + fprintf(stderr, "Duplicate array-key: %s detected. " + "It is recommended to get rid of the duplicate entry.\n", B->key->ptr); ctx->ok = 0; B->free(B);
Updated by stbuehler almost 9 years ago
I'll extend it slightly; given how the parser works right now I don't think we can simply replace the parser error message.
Updated by stbuehler almost 9 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset r3085.
Also available in: Atom