MCPcopy Create free account
hub / github.com/Ember-Moth/ppanel / new_err_code

Method new_err_code

crates/result/src/code_error.rs:24–29  ·  view source on GitHub ↗

Creates a `CodeError` whose message is looked up from [`map_err_msg`]. Mirrors Go `xerr.NewErrCode`.

(err_code: u32)

Source from the content-addressed store, hash-verified

22 ///
23 /// Mirrors Go `xerr.NewErrCode`.
24 pub fn new_err_code(err_code: u32) -> Self {
25 Self {
26 err_code,
27 err_msg: map_err_msg(err_code).to_string(),
28 }
29 }
30
31 /// Creates a `CodeError` with an explicit code and message.
32 ///

Callers

nothing calls this directly

Calls 1

map_err_msgFunction · 0.85

Tested by

no test coverage detected