+4
-3
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <noto/detail/errors.hpp>
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
auto code_from(std::int32_t code) -> std::int32_t {
|
||||
@@ -51,7 +52,7 @@ auto code_from(std::int32_t code) -> std::int32_t {
|
||||
}
|
||||
}
|
||||
|
||||
auto message_from(std::int32_t code, sqlite3* database, std::string_view operation) -> std::string {
|
||||
auto message_from(std::int32_t code, sqlite3 *database, std::string_view operation) -> std::string {
|
||||
auto message = std::string{};
|
||||
if (!operation.empty()) {
|
||||
message += operation;
|
||||
@@ -67,11 +68,11 @@ auto message_from(std::int32_t code, sqlite3* database, std::string_view operati
|
||||
|
||||
}
|
||||
|
||||
auto noto::error_from(std::int32_t code, sqlite3* database, std::string_view operation) -> modulus::error {
|
||||
auto noto::error_from(std::int32_t code, sqlite3 *database, std::string_view operation) -> modulus::error {
|
||||
return noto::detail::make_error(code_from(code), message_from(code, database, operation));
|
||||
}
|
||||
|
||||
auto noto::result_from(std::int32_t code, sqlite3* database, std::string_view operation) -> std::expected<void, modulus::error> {
|
||||
auto noto::result_from(std::int32_t code, sqlite3 *database, std::string_view operation) -> std::expected<void, modulus::error> {
|
||||
if (code == SQLITE_OK || code == SQLITE_ROW || code == SQLITE_DONE) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user