Skip to content

fix: improve panic message for unknown encoder format - #999

Open
AruneshDwivedi wants to merge 1 commit into
prometheus:mainfrom
AruneshDwivedi:fix/encoder-unknown-format-panic
Open

AruneshDwivedi wants to merge 1 commit into
prometheus:mainfrom
AruneshDwivedi:fix/encoder-unknown-format-panic

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

The NewEncoder function panics with an opaque format string when passed an unknown format, providing no guidance to users on how to resolve the misconfiguration. This improves the panic message to suggest using a valid Format or the NewFormat constructor with a known FormatType.

The NewEncoder function panicked with an opaque format string when
passed an unknown format, providing no guidance to users on how to
resolve the misconfiguration. Add a suggestion to use a valid Format
or the NewFormat constructor with a known FormatType.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@bwplotka

Copy link
Copy Markdown
Member

Is this really helping? If you have unknown format isn't it obvious you need to provide known one? NewFormat does not help as it can return Unknown one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants