Add NoResultsError (#121)

This commit is contained in:
Jeremy Woertink 2020-02-17 13:04:23 -08:00 committed by GitHub
parent f128d6ddf3
commit f08a4da60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -29,4 +29,8 @@ module DB
class Rollback < Error
end
# Raised when a scalar query returns no results.
class NoResultsError < Error
end
end

View file

@ -15,7 +15,7 @@ module DB
end
end
raise "no results"
raise NoResultsError.new("no results")
end
# See `QueryMethods#query`