]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab ft=cpp | |
3 | ||
4 | /* | |
5 | * Ceph - scalable distributed file system | |
6 | * | |
7 | * Copyright (C) 2022 Red Hat, Inc. | |
8 | * | |
9 | * This is free software; you can redistribute it and/or | |
10 | * modify it under the terms of the GNU Lesser General Public | |
11 | * License version 2.1, as published by the Free Software | |
12 | * Foundation. See file COPYING. | |
13 | * | |
14 | */ | |
15 | ||
16 | #include "error.h" | |
17 | ||
18 | namespace rgw::dbstore::sqlite { | |
19 | ||
20 | const std::error_category& error_category() | |
21 | { | |
22 | struct category : std::error_category { | |
23 | const char* name() const noexcept override { | |
24 | return "dbstore:sqlite"; | |
25 | } | |
26 | std::string message(int ev) const override { | |
27 | return ::sqlite3_errstr(ev); | |
28 | } | |
29 | std::error_condition default_error_condition(int code) const noexcept override { | |
30 | return {code & 0xFF, category()}; | |
31 | } | |
32 | }; | |
33 | static category instance; | |
34 | return instance; | |
35 | } | |
36 | ||
37 | } // namespace rgw::dbstore::sqlite |