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

making exception error string a proper error class. #121

Merged
merged 2 commits into from
Feb 17, 2020

Conversation

jwoertink
Copy link
Contributor

Fixes #120

I was going to write a spec for it, but the specs in this are sort of complicated, and I wasn't sure how to test that the scalar raises an exception.

@straight-shoota
Copy link
Member

How about SELECT LIMIT 0?

@jwoertink
Copy link
Contributor Author

I tried doing this:

    with_dummy do |db|
      expect_raises DB::NoResultsError do
        db.scalar "SELECT LIMIT 0"
      end
    end

but it never raises an exception.

@jwoertink
Copy link
Contributor Author

ah, nevermind, I was using the wrong thing.

@jwoertink
Copy link
Contributor Author

Hey, just wanted to ping this. If anyone has a second to look over it. Thanks!

@straight-shoota straight-shoota merged commit f08a4da into crystal-lang:master Feb 17, 2020
@straight-shoota
Copy link
Member

Thanks @jwoertink

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.

A better error for "no results"
3 participants