Skip to content

Commit e34b4f6

Browse files
authored
Merge pull request #62 from ulrichbayer/dedicated_exceptions
Throw dedicated exceptions
2 parents 47cb1a0 + 1a5b443 commit e34b4f6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ namespace sqlite {
8888
else if(error_code == SQLITE_NOTADB) throw exceptions::notadb(sqlite3_errstr(error_code));
8989
else throw sqlite_exception(sqlite3_errstr(error_code));
9090
}
91-
92-
static void throw_custom_error(const char* str) {
93-
throw std::runtime_error(str);
94-
}
95-
9691
}
9792

9893
class database;
@@ -174,11 +169,11 @@ namespace sqlite {
174169
if((hresult = sqlite3_step(_stmt.get())) == SQLITE_ROW) {
175170
call_back();
176171
} else if(hresult == SQLITE_DONE) {
177-
exceptions::throw_custom_error("no rows to extract: exactly 1 row expected");
172+
throw exceptions::no_rows("no rows to extract: exactly 1 row expected");
178173
}
179174

180175
if((hresult = sqlite3_step(_stmt.get())) == SQLITE_ROW) {
181-
exceptions::throw_custom_error("not all rows extracted");
176+
throw exceptions::more_rows("not all rows extracted");
182177
}
183178

184179
if(hresult != SQLITE_DONE) {

0 commit comments

Comments
 (0)