Skip to content

MODIFIED: Filter Logging System Panic#24

Open
Sommos wants to merge 1 commit intoStumblinbear:masterfrom
Sommos:master
Open

MODIFIED: Filter Logging System Panic#24
Sommos wants to merge 1 commit intoStumblinbear:masterfrom
Sommos:master

Conversation

@Sommos
Copy link

@Sommos Sommos commented Dec 17, 2023

You are calling unwrap() on the result of a parse(). The unwrap() function returns the value inside an Ok variant, but if the Result is an Err, it will cause the program to panic and terminate.

Pull request type

Potential Bug Fix

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Currently, calling unwrap() on the result of parse() within these filters can cause the program to panic and terminate if an Err is returned instead of the expected Ok.

Issue Number: N/A

What is the new behavior?

  • Now, it should handle an Err Result far more cleanly, with a proper error message, instead of panicing and terminating the whole program.

Other information

N/A

@Stumblinbear
Copy link
Owner

Technically yes, but the likelyhood of this failing to parse is zero since it's guaranteed to be well-formed. Generally .unwrap() is "fine" if you're positive it's a safe operation

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