Skip to content

Commit ef97a7b

Browse files
committed
Throw dedicated exceptions
Use the already prepared exception classes no_rows and more_rows when there are no more rows or more rows than expected.
1 parent 47cb1a0 commit ef97a7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ namespace sqlite {
174174
if((hresult = sqlite3_step(_stmt.get())) == SQLITE_ROW) {
175175
call_back();
176176
} else if(hresult == SQLITE_DONE) {
177-
exceptions::throw_custom_error("no rows to extract: exactly 1 row expected");
177+
throw exceptions::no_rows("no rows to extract: exactly 1 row expected");
178178
}
179179

180180
if((hresult = sqlite3_step(_stmt.get())) == SQLITE_ROW) {
181-
exceptions::throw_custom_error("not all rows extracted");
181+
throw exceptions::more_rows("not all rows extracted");
182182
}
183183

184184
if(hresult != SQLITE_DONE) {

0 commit comments

Comments
 (0)