Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhanced error handling in parseAlphaNumTime fn #878

Merged
merged 2 commits into from
May 20, 2024

Conversation

gouthamhusky
Copy link
Contributor

Description

Enhanced the error handling in the parseAlphaNumTime() to deal with invalid string inputs that do not adhere to the 'now-[Num][Unit]' format

Fixes #539 : Add error handling to parseAlphaNumTime

Testing

Added 3 more cases to the Test_parseAlphaNumTime() method of the searchHandler_test.go file with the following input strings:

  • invalidTimeString: an invalid string that would cause the method to return the default value
  • now-365x: an input with an invalid time unit of 'x'
  • now-5xm: input with an invalid number '5x', which would cause an integer parsing error

Checklist:

  • [✅] I have self-reviewed this PR.
  • [✅] I have removed all print-debugging and commented-out code that should not be merged.
  • [✅] I have added sufficient comments in my code, particularly in hard-to-understand areas.
  • [✅] I have formatted the code, if applicable. For Go, I have run goimports -w ..

@AndrewHess AndrewHess merged commit 8d34de8 into siglens:develop May 20, 2024
2 checks passed
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.

[STORY] Add error handling to parseAlphaNumTime
2 participants