refactor: replace panic with a graceful exit #1204

Closed
opened 2026-04-06 01:41:30 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @tessus on 3/3/2024

This change replaces the panic when a wrong log level is used with an error message and a graceful exit.

Please note that I did not hardcode the levels, because I rather dislike hardcoding options, if there's a way to retrieve the list dynamically. It makes the code by 9 lines longer, but it is more futureproof.

Either way, if this is not wanted, I can still hardcode the list.

see https://github.com/dani-garcia/vaultwarden/discussions/4393#discussioncomment-8656343

*Originally created by @tessus on 3/3/2024* This change replaces the panic when a wrong log level is used with an error message and a graceful exit. Please note that I did not hardcode the levels, because I rather dislike hardcoding options, if there's a way to retrieve the list dynamically. ~~It makes the code by 9 lines longer, but it is more futureproof.~~ Either way, if this is not wanted, I can still hardcode the list. see https://github.com/dani-garcia/vaultwarden/discussions/4393#discussioncomment-8656343
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1204