fix: Add RecoverableError
--- don't change below this line --- ENG-4076 <#DTT#>
This commit is contained in:
@@ -9,6 +9,9 @@ use thiserror::Error;
|
|||||||
/// Variants:
|
/// Variants:
|
||||||
/// - `InvalidInput`: Indicates that the encoding has failed due to bad input parameters.
|
/// - `InvalidInput`: Indicates that the encoding has failed due to bad input parameters.
|
||||||
/// - `FatalError`: There is problem with the application setup.
|
/// - `FatalError`: There is problem with the application setup.
|
||||||
|
/// - `RecoverableError`: Indicates that the encoding has failed with a recoverable error. Retrying
|
||||||
|
/// at a later time may succeed. It may have failed due to a temporary issue, such as a network
|
||||||
|
/// problem.
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub enum EncodingError {
|
pub enum EncodingError {
|
||||||
@@ -16,6 +19,8 @@ pub enum EncodingError {
|
|||||||
InvalidInput(String),
|
InvalidInput(String),
|
||||||
#[error("Fatal error: {0}")]
|
#[error("Fatal error: {0}")]
|
||||||
FatalError(String),
|
FatalError(String),
|
||||||
|
#[error("Recoverable error: {0}")]
|
||||||
|
RecoverableError(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<io::Error> for EncodingError {
|
impl From<io::Error> for EncodingError {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use alloy_sol_types::SolValue;
|
|
||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
|
|
||||||
use crate::encoding::{
|
use crate::encoding::{
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
use alloy_primitives::Address;
|
use alloy_primitives::Address;
|
||||||
use alloy_sol_types::SolValue;
|
use alloy_sol_types::SolValue;
|
||||||
use num_bigint::BigUint;
|
|
||||||
use num_traits::Zero;
|
|
||||||
|
|
||||||
use crate::encoding::{
|
use crate::encoding::{
|
||||||
errors::EncodingError,
|
errors::EncodingError,
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
use crate::encoding::{
|
use crate::encoding::{errors::EncodingError, models::Solution};
|
||||||
errors::EncodingError,
|
|
||||||
models::{ActionType, Solution},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub trait StrategyEncoder {
|
pub trait StrategyEncoder {
|
||||||
|
|||||||
Reference in New Issue
Block a user