Expand description
Kvault program error codes.
Anchor custom errors start at offset 6000. Kvault errors use offsets starting at 1000,
so error codes start at 7000. Each variant’s error code is 6000 + offset.
Use KvaultError::from_error_code to convert an on-chain error code back to a variant,
or TryFrom<u32> for the same purpose.
§Example
use kvault_interface::KvaultError;
let error = KvaultError::from_error_code(7002);
assert_eq!(error, Some(KvaultError::MathOverflow));
assert_eq!(error.unwrap().error_code(), 7002);
assert_eq!(
error.unwrap().to_string(),
"Math operation overflowed"
);