Go to file
jordi fita mas 0e371d71dd Check QSqlQuery errors when doing a query
This is more for me than the end user, because if there is an error with
a query, there is—almost aways—nothing a user can do, since it is
probably an error in the static SQL string or the database.  However, it
is better to show an error, than to do nothing at all when there is a
failure.

According to Qt’s documentation[0], QFuture relies on exceptions for the
error handling. At first i assumed that i had to attach an onFailed
handler to QFuture in order to receive that exception and skip the then
handler.

However, i can not attach the onFailure inside Database::query, before
returning the QFuture, because the subsequent then is only executed when
there _is_ an error, never in the normal, non-exceptional, case.  I
would have to add the onFailure after then.

Nonetheless, i found out that there is no need for onFailure: since i do
not call result(), i do not get the exception, and the actual work is
performed in the then handler when no exception is raised.

[0]: https://doc.qt.io/qt-6/qfuture.html
2025-01-15 13:01:40 +01:00
cmd/camper Increase HTTP timeout 2024-03-05 12:05:00 +01:00
debian Include weasyprint as dependency of camper package 2024-04-28 21:47:44 +02:00
demo Add season dates for “next year” 2024-11-20 19:43:59 +01:00
deploy Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00
pkg Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00
po Fix French typo 2024-07-15 23:12:12 +02:00
revert Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00
src Check QSqlQuery errors when doing a query 2025-01-15 13:01:40 +01:00
test Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00
verify Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00
web Change “ACSI” to “ACSI / ANWB” 2024-05-13 10:40:21 +02:00
.gitignore Add skeleton for a QML application 2024-12-14 01:19:20 +01:00
CMakeLists.txt Add a very ugly login page to test database connection 2024-12-16 12:59:19 +01:00
Makefile Send an email on notification of success payment 2024-02-13 05:20:35 +01:00
go.mod Add customer and invoices sections 2024-04-28 20:28:45 +02:00
go.sum Add customer and invoices sections 2024-04-28 20:28:45 +02:00
guix.scm Remove postgresql-iban from guix.scm 2024-12-24 04:04:39 +01:00
sqitch.conf Add empty Sqitch configuration anq plan files 2023-07-20 23:43:23 +02:00
sqitch.plan Add operating_dates to campsite type table 2024-07-15 23:41:47 +02:00