{"record":{"id":"bb159ec4d52d24f1","repo":"diem/diem","slug":"verificationerror-0","errorCode":null,"errorMessage":"VerificationError({0:?})","messagePattern":"VerificationError\\((.+?)\\)","errorType":"error_code","errorClass":"ErrorKind::VerificationError","httpStatus":null,"severity":"error","filePath":"language/testing-infra/functional-tests/src/errors.rs","lineNumber":22,"sourceCode":"pub use anyhow::{anyhow, bail, format_err, Error, Result};\nuse diem_types::{transaction::TransactionOutput, vm_status::VMStatus};\nuse thiserror::Error;\n\n/// Defines all errors in this crate.\n#[derive(Clone, Debug, Error)]\npub enum ErrorKind {\n    #[error(\n        \"an error occurred when executing the transaction, vm status {:?}, txn status {:?}\",\n        .0,\n        .1.status(),\n    )]\n    VMExecutionFailure(VMStatus, TransactionOutput),\n    #[error(\"the transaction was discarded: {0:?}\")]\n    DiscardedTransaction(TransactionOutput),\n    #[error(\"the checker has failed to match the directives against the output\")]\n    CheckerFailure,\n    // TODO replace VMStatus with VMError\n    #[error(\"VerificationError({0:?})\")]\n    VerificationError(VMStatus),\n    #[error(\"other error: {0}\")]\n    #[allow(dead_code)]\n    Other(String),\n}\n","sourceCodeStart":4,"sourceCodeEnd":28,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/language/testing-infra/functional-tests/src/errors.rs#L4-L28","documentation":"ErrorKind::VerificationError wraps a VMStatus (stand-in for VMError, per the TODO) when Move bytecode verification of a published module or script fails. Its display is 'VerificationError(<VMStatus>)'.","triggerScenarios":"Publishing or running bytecode that fails Move verifier checks: type safety violations, illegal references, bad bytecode from hand-crafted modules, or linking failures against dependencies.","commonSituations":"Hand-writing bytecode in tests, publishing a module whose dependencies were updated, scripting raw module bytes instead of source compilation.","solutions":["Read the wrapped VMStatus for the specific verification failure kind and fix the bytecode/source","Recompile the module from valid Move source with the current compiler","Ensure dependency modules on-chain match the versions compiled against"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Compile from Move source and let the compiler catch verifier-level issues first\nlet compiled = move_compiler::compile(source)?;","typeGuard":"fn is_verification_error(e: &ErrorKind) -> Option<&VMStatus> {\n    if let ErrorKind::VerificationError(s) = e { Some(s) } else { None }\n}","tryCatchPattern":"if let ErrorKind::VerificationError(status) = err {\n    eprintln!(\"bytecode failed verification: {:?}\", status);\n}","preventionTips":["Always compile modules from Move source with the current compiler, never hand-crafted bytes","Keep on-chain dependency modules in sync with compiled versions","Run module publish in a testnet before main deployment"],"tags":["rust","move-verifier","bytecode"],"backgroundTag":"verification-error","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}