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

"This should basically never happen" #204

Open
JWesorick opened this issue Dec 17, 2014 · 2 comments
Open

"This should basically never happen" #204

JWesorick opened this issue Dec 17, 2014 · 2 comments
Assignees
Labels

Comments

@JWesorick
Copy link

So this exception wan't super helpful and also, despite what the exception says, it did happen. I was making a call to fetch a bank account:

Balanced::BankAccount.fetch("/bank_accounts/#{bank_account_id}")

where bank_account_id = nil. I understand the error is that the id is nil, but it seems like it should either be caught earlier or have a better exception message.

https://github.com/balanced/balanced-ruby/blob/master/lib/balanced/resources/resource.rb#L243

@remear
Copy link
Contributor

remear commented Jan 5, 2015

@JWesorick I agree with making some changes here to better catch this error.

With that being said, this is also the result of manually building hrefs, which we ask API consumers not to do. You should store and use the href attribute supplied in API responses and not manually build them with stored IDs.

@Irio
Copy link

Irio commented Jan 13, 2015

Did happen for me. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants