MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / to_error_msg

Function to_error_msg

fendermint/app/src/tmconv.rs:314–339  ·  view source on GitHub ↗
(exit_code: ExitCode)

Source from the content-addressed store, hash-verified

312}
313
314pub fn to_error_msg(exit_code: ExitCode) -> &'static str {
315 match exit_code {
316 ExitCode::OK => "",
317 ExitCode::SYS_SENDER_INVALID => "The message sender doesn't exist.",
318 ExitCode::SYS_SENDER_STATE_INVALID => "The message sender was not in a valid state to send this message. Either the nonce didn't match, or the sender didn't have funds to cover the message gas.",
319 ExitCode::SYS_ILLEGAL_INSTRUCTION => "The message receiver trapped (panicked).",
320 ExitCode::SYS_INVALID_RECEIVER => "The message receiver doesn't exist and can't be automatically created",
321 ExitCode::SYS_INSUFFICIENT_FUNDS => "The message sender didn't have the requisite funds.",
322 ExitCode::SYS_OUT_OF_GAS => "Message execution (including subcalls) used more gas than the specified limit.",
323 ExitCode::SYS_ILLEGAL_EXIT_CODE => "The message receiver aborted with a reserved exit code.",
324 ExitCode::SYS_ASSERTION_FAILED => "An internal VM assertion failed.",
325 ExitCode::SYS_MISSING_RETURN => "The actor returned a block handle that doesn't exist",
326 ExitCode::USR_ILLEGAL_ARGUMENT => "The method parameters are invalid.",
327 ExitCode::USR_NOT_FOUND => "The requested resource does not exist.",
328 ExitCode::USR_FORBIDDEN => "The requested operation is forbidden.",
329 ExitCode::USR_INSUFFICIENT_FUNDS => "The actor has insufficient funds to perform the requested operation.",
330 ExitCode::USR_ILLEGAL_STATE => "The actor's internal state is invalid.",
331 ExitCode::USR_SERIALIZATION => "There was a de/serialization failure within actor code.",
332 ExitCode::USR_UNHANDLED_MESSAGE => "The message cannot be handled (usually indicates an unhandled method number).",
333 ExitCode::USR_UNSPECIFIED => "The actor failed with an unspecified error.",
334 ExitCode::USR_ASSERTION_FAILED => "The actor failed a user-level assertion.",
335 ExitCode::USR_READ_ONLY => "The requested operation cannot be performed in 'read-only' mode.",
336 ExitCode::USR_NOT_PAYABLE => "The method cannot handle a transfer of value.",
337 _ => ""
338 }
339}
340
341pub fn to_snapshots(
342 snapshots: impl IntoIterator<Item = SnapshotItem>,

Callers 3

to_deliver_txFunction · 0.85
to_check_txFunction · 0.85
to_queryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected