MCPcopy Create free account
hub / github.com/bytedance/bolt / toString

Function toString

bolt/common/base/Status.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace bytedance::bolt {
39
40std::string_view toString(StatusCode code) {
41 switch (code) {
42 case StatusCode::kOK:
43 return "OK";
44 case StatusCode::kUserError:
45 return "User error";
46 case StatusCode::kTypeError:
47 return "Type error";
48 case StatusCode::kIndexError:
49 return "Index error";
50 case StatusCode::kKeyError:
51 return "Key error";
52 case StatusCode::kAlreadyExists:
53 return "Already exists";
54 case StatusCode::kOutOfMemory:
55 return "Out of memory";
56 case StatusCode::kIOError:
57 return "IOError";
58 case StatusCode::kCancelled:
59 return "Cancelled";
60 case StatusCode::kInvalid:
61 return "Invalid";
62 case StatusCode::kUnknownError:
63 return "Unknown error";
64 case StatusCode::kNotImplemented:
65 return "NotImplemented";
66 }
67 return ""; // no-op
68}
69
70Status::Status(StatusCode code, std::string msg) {
71 if (FOLLY_UNLIKELY(code == StatusCode::kOK)) {

Callers 15

mayContainMethod · 0.70
insertMethod · 0.70
HashMethod · 0.70
codeAsStringMethod · 0.70
abortMethod · 0.70
warnMethod · 0.70
formatMethod · 0.70
toStringMethod · 0.50
~AllocationMethod · 0.50
~ContiguousAllocationMethod · 0.50
~MmapAllocatorMethod · 0.50

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.40