Sqlite: Extend error handling

We do only handled errors for the v1 interface. Now we handle much more.
Sadly this is hard to test, so there are no tests.

Change-Id: I6f55dc1bad744776bb33a6d0d6c71e52d2f097f6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-06-16 00:05:33 +02:00
committed by Tim Jenssen
parent 1b6a0a290b
commit ce942bd33c
3 changed files with 206 additions and 14 deletions

View File

@@ -109,7 +109,7 @@ public:
[[noreturn]] void throwStatementIsBusy(const char *whatHasHappened) const;
[[noreturn]] void throwStatementHasError(const char *whatHasHappened) const;
[[noreturn]] void throwStatementIsMisused(const char *whatHasHappened) const;
[[noreturn]] void throwIoError(const char *whatHasHappened) const;
[[noreturn]] void throwInputOutputError(const char *whatHasHappened) const;
[[noreturn]] void throwConstraintPreventsModification(const char *whatHasHappened) const;
[[noreturn]] void throwNoValuesToFetch(const char *whatHasHappened) const;
[[noreturn]] void throwInvalidColumnFetched(const char *whatHasHappened) const;
@@ -117,6 +117,16 @@ public:
[[noreturn]] void throwWrongBingingName(const char *whatHasHappened) const;
[[noreturn]] void throwUnknowError(const char *whatHasHappened) const;
[[noreturn]] void throwBingingTooBig(const char *whatHasHappened) const;
[[noreturn]] void throwTooBig(const char *whatHasHappened) const;
[[noreturn]] void throwSchemaChangeError(const char *whatHasHappened) const;
[[noreturn]] void throwCannotWriteToReadOnlyConnection(const char *whatHasHappened) const;
[[noreturn]] void throwProtocolError(const char *whatHasHappened) const;
[[noreturn]] void throwDatabaseExceedsMaximumFileSize(const char *whatHasHappened) const;
[[noreturn]] void throwDataTypeMismatch(const char *whatHasHappened) const;
[[noreturn]] void throwConnectionIsLocked(const char *whatHasHappened) const;
[[noreturn]] void throwExecutionInterrupted(const char *whatHasHappened) const;
[[noreturn]] void throwDatabaseIsCorrupt(const char *whatHasHappened) const;
[[noreturn]] void throwCannotOpen(const char *whatHasHappened) const;
QString columnName(int column) const;