-
Notifications
You must be signed in to change notification settings - Fork 21
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
Improve development/test env error messages for Stitches #114
base: main
Are you sure you want to change the base?
Improve development/test env error messages for Stitches #114
Conversation
lib/stitches/api_key.rb
Outdated
message = "no authorization header" | ||
|
||
if Rails.env.test? || Rails.env.development? | ||
message += "(Development/Test Env Hint: Stitches issue; confirm your API key header is set OR check the `allowlist_regex` for this path)" |
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 also considered including the regex for reference. 🤔
eb7da01
to
56086eb
Compare
56086eb
to
85fc6f2
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.
🏆
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.
🥇 looks great and definitely more helpful
The current error message isn't helpful for development, so provide a helpful hint in the Rails development and test environments.
85fc6f2
to
773dccd
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.
this is realllllllly nice, thanks! and it would be nice to see the regex, it may save you from a binding.pry 🤷♀️ but either way, amaze. thank you!
Problem
The current error message isn't helpful for developers during local development. It is always a confusing experience when the following is displayed unless you're familiar with Stitches:
Solution
Provide a helpful hint in the Rails development and test environments pointing to missing headers or mismatched
allowlist_regex
.