MCPcopy Create free account
hub / github.com/ceph/ceph / from_code

Method from_code

src/common/error_code.cc:117–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117int ceph_error_category::from_code(int ev) const noexcept {
118 if (ev == 0)
119 return 0;
120
121 switch (static_cast<errc>(ev)) {
122 case errc::not_in_map:
123 case errc::does_not_exist:
124 // What we use now.
125 return -ENOENT;
126 case errc::failure:
127 return -EIO;
128 case errc::exists:
129 return -EEXIST;
130 case errc::limit_exceeded:
131 return -EIO;
132 case errc::auth:
133 return -EACCES;
134 case errc::conflict:
135 return -EINVAL;
136 }
137 return -EDOM;
138}
139
140const error_category& ceph_category() noexcept {
141 static const ceph_error_category c;

Callers 1

from_error_codeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected