-
Notifications
You must be signed in to change notification settings - Fork 0
STR-357 :: If fingerprint analytics fails, continue anyways #99
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
Conversation
b80ba2f
to
af68d22
Compare
afcc43d
to
84d4a15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some optional suggestions. If you decide to commit them, let me know and I'll re-approve.
if err != nil { | ||
if strings.Contains(err.Error(), "unknown device") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way of checking the error is fine, but we can also check the top level error like so:
if strings.Contains(err.Error(), "unknown device") { | |
if err != nil && errors.Cause(err).Error() == "unknown device" { |
Which you can see on api/handler/quotes.go:41
if strings.Contains(err.Error(), "unknown device") { | ||
return Unprocessable(c) | ||
} | ||
if strings.Contains(err.Error(), "invalid email") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea here as above. You could also say:
if strings.Contains(err.Error(), "invalid email") { | |
if errors.Cause(err).Error() == "invalid email" { |
How to test:
fix/wil/str-357
docker-compose up redis db string-api --build
VITE_ANALYTICS_LIB_PK=123