mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-01 11:19:52 +03:00
[PR #4402] [MERGED] refactor: replace panic with a graceful exit #3397
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/4402
Author: @tessus
Created: 3/4/2024
Status: ✅ Merged
Merged: 3/17/2024
Merged by: @dani-garcia
Base:
main← Head:fix/panic📝 Commits (4)
96e2732refactor: replace panic with a graceful exitbab174efix: clippy errorsd8515cbfix: typo93c7d8cUpdate src/main.rs📊 Changes
1 file changed (+5 additions, -1 deletions)
View changed files
📝
src/main.rs(+5 -1)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.