1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Aptos Node API
*
* The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
*
* The version of the OpenAPI document: 1.2.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AptosError : This is the generic struct we use for all API errors, it contains a string message and an Aptos API specific error code.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AptosError {
/// A message describing the error
#[serde(rename = "message")]
pub message: String,
#[serde(rename = "error_code")]
pub error_code: models::AptosErrorCode,
/// A code providing VM error details when submitting transactions to the VM
#[serde(rename = "vm_error_code", skip_serializing_if = "Option::is_none")]
pub vm_error_code: Option<i32>,
}
impl AptosError {
/// This is the generic struct we use for all API errors, it contains a string message and an Aptos API specific error code.
pub fn new(message: String, error_code: models::AptosErrorCode) -> AptosError {
AptosError {
message,
error_code,
vm_error_code: None,
}
}
}