4
4
5
5
#pragma once
6
6
7
- #include < atomic>
8
7
#include < string>
9
8
#include < string_view>
10
9
@@ -15,35 +14,37 @@ std::string ConfigSetFailed(std::string_view config_name);
15
14
std::string InvalidExpireTime (std::string_view cmd);
16
15
std::string UnknownSubCmd (std::string_view subcmd, std::string_view cmd);
17
16
18
- extern const char kSyntaxErr [];
19
- extern const char kWrongTypeErr [];
20
- extern const char kWrongJsonTypeErr [];
21
- extern const char kKeyNotFoundErr [];
22
- extern const char kInvalidIntErr [];
23
- extern const char kInvalidFloatErr [];
24
- extern const char kUintErr [];
25
- extern const char kIncrOverflow [];
26
- extern const char kDbIndOutOfRangeErr [];
27
- extern const char kInvalidDbIndErr [];
28
- extern const char kScriptNotFound [];
29
- extern const char kAuthRejected [];
30
- extern const char kExpiryOutOfRange [];
31
- extern const char kIndexOutOfRange [];
32
- extern const char kOutOfMemory [];
33
- extern const char kInvalidNumericResult [];
34
- extern const char kClusterNotConfigured [];
35
- extern const char kLoadingErr [];
36
- extern const char kUndeclaredKeyErr [];
37
- extern const char kInvalidDumpValueErr [];
38
- extern const char kInvalidJsonPathErr [];
39
- extern const char kJsonParseError [];
40
- extern const char kCrossSlotError [];
17
+ inline constexpr char kSyntaxErr [] = " syntax error" ;
18
+ inline constexpr char kWrongTypeErr [] =
19
+ " -WRONGTYPE Operation against a key holding the wrong kind of value" ;
20
+ inline constexpr char kWrongJsonTypeErr [] = " -WRONGTYPE wrong JSON type of path value" ;
21
+ inline constexpr char kKeyNotFoundErr [] = " no such key" ;
22
+ inline constexpr char kInvalidIntErr [] = " value is not an integer or out of range" ;
23
+ inline constexpr char kInvalidFloatErr [] = " value is not a valid float" ;
24
+ inline constexpr char kUintErr [] = " value is out of range, must be positive" ;
25
+ inline constexpr char kIncrOverflow [] = " increment or decrement would overflow" ;
26
+ inline constexpr char kDbIndOutOfRangeErr [] = " DB index is out of range" ;
27
+ inline constexpr char kInvalidDbIndErr [] = " invalid DB index" ;
28
+ inline constexpr char kScriptNotFound [] = " -NOSCRIPT No matching script. Please use EVAL." ;
29
+ inline constexpr char kAuthRejected [] =
30
+ " -WRONGPASS invalid username-password pair or user is disabled." ;
31
+ inline constexpr char kExpiryOutOfRange [] = " expiry is out of range" ;
32
+ inline constexpr char kIndexOutOfRange [] = " index out of range" ;
33
+ inline constexpr char kOutOfMemory [] = " Out of memory" ;
34
+ inline constexpr char kInvalidNumericResult [] = " result is not a number" ;
35
+ inline constexpr char kClusterNotConfigured [] = " Cluster is not yet configured" ;
36
+ inline constexpr char kLoadingErr [] = " -LOADING Dragonfly is loading the dataset in memory" ;
37
+ inline constexpr char kUndeclaredKeyErr [] = " script tried accessing undeclared key" ;
38
+ inline constexpr char kInvalidDumpValueErr [] = " DUMP payload version or checksum are wrong" ;
39
+ inline constexpr char kInvalidJsonPathErr [] = " invalid JSON path" ;
40
+ inline constexpr char kJsonParseError [] = " failed to parse JSON" ;
41
+ inline constexpr char kCrossSlotError [] = " -CROSSSLOT Keys in request don't hash to the same slot" ;
41
42
42
- extern const char kSyntaxErrType [];
43
- extern const char kScriptErrType [];
44
- extern const char kConfigErrType [];
45
- extern const char kSearchErrType [];
46
- extern const char kWrongTypeErrType [];
47
- extern const char kRestrictDenied [];
43
+ inline constexpr char kSyntaxErrType [] = " syntax_error " ;
44
+ inline constexpr char kScriptErrType [] = " script_error " ;
45
+ inline constexpr char kConfigErrType [] = " config_error " ;
46
+ inline constexpr char kSearchErrType [] = " search_error " ;
47
+ inline constexpr char kWrongTypeErrType [] = " wrong_type " ;
48
+ inline constexpr char kRestrictDenied [] = " restrict_denied " ;
48
49
49
50
} // namespace facade
0 commit comments