-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise an error when requests params are invalid (#874)
There are two kinds of API operations: collection and element specific. The signature between the two is slightly different: - **collection**: (params, opts) - **element specific**: (id, params, opts) If a user doesn't realize the difference, they may attempt to use the collection signature when performing an element specific operation like: ``` Stripe::PaymentIntent.cancel('pi_1234', 'sk_test_key') # Results in an error: NoMethodError: undefined method `key?' for "sk_test" ``` The resulting error message isn't very useful for debugging. Instead,this PR adds a message letting the user know what it's expecting: `request params should be either a Hash or nil (was a String)`
- Loading branch information
1 parent
4e564a1
commit 299e9ea
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters