forked from ROMEO/nexosim
Check clock sync with configurable tolerance
This commit is contained in:
@ -17,6 +17,7 @@ enum ErrorCode {
|
||||
SIMULATION_PANIC = 6;
|
||||
SIMULATION_BAD_QUERY = 7;
|
||||
SIMULATION_TIME_OUT_OF_RANGE = 8;
|
||||
SIMULATION_OUT_OF_SYNC = 9;
|
||||
MISSING_ARGUMENT = 20;
|
||||
INVALID_TIME = 30;
|
||||
INVALID_DURATION = 31;
|
||||
|
@ -345,6 +345,7 @@ pub enum ErrorCode {
|
||||
SimulationPanic = 6,
|
||||
SimulationBadQuery = 7,
|
||||
SimulationTimeOutOfRange = 8,
|
||||
SimulationOutOfSync = 9,
|
||||
MissingArgument = 20,
|
||||
InvalidTime = 30,
|
||||
InvalidDuration = 31,
|
||||
@ -370,6 +371,7 @@ impl ErrorCode {
|
||||
ErrorCode::SimulationPanic => "SIMULATION_PANIC",
|
||||
ErrorCode::SimulationBadQuery => "SIMULATION_BAD_QUERY",
|
||||
ErrorCode::SimulationTimeOutOfRange => "SIMULATION_TIME_OUT_OF_RANGE",
|
||||
ErrorCode::SimulationOutOfSync => "SIMULATION_OUT_OF_SYNC",
|
||||
ErrorCode::MissingArgument => "MISSING_ARGUMENT",
|
||||
ErrorCode::InvalidTime => "INVALID_TIME",
|
||||
ErrorCode::InvalidDuration => "INVALID_DURATION",
|
||||
@ -392,6 +394,7 @@ impl ErrorCode {
|
||||
"SIMULATION_PANIC" => Some(Self::SimulationPanic),
|
||||
"SIMULATION_BAD_QUERY" => Some(Self::SimulationBadQuery),
|
||||
"SIMULATION_TIME_OUT_OF_RANGE" => Some(Self::SimulationTimeOutOfRange),
|
||||
"SIMULATION_OUT_OF_SYNC" => Some(Self::SimulationOutOfSync),
|
||||
"MISSING_ARGUMENT" => Some(Self::MissingArgument),
|
||||
"INVALID_TIME" => Some(Self::InvalidTime),
|
||||
"INVALID_DURATION" => Some(Self::InvalidDuration),
|
||||
|
@ -36,9 +36,10 @@ fn map_execution_error(error: ExecutionError) -> Error {
|
||||
ExecutionError::Deadlock(_) => ErrorCode::SimulationDeadlock,
|
||||
ExecutionError::ModelError { .. } => ErrorCode::SimulationModelError,
|
||||
ExecutionError::Panic(_) => ErrorCode::SimulationPanic,
|
||||
ExecutionError::Timeout => ErrorCode::SimulationTimeout,
|
||||
ExecutionError::OutOfSync(_) => ErrorCode::SimulationOutOfSync,
|
||||
ExecutionError::BadQuery => ErrorCode::SimulationBadQuery,
|
||||
ExecutionError::Terminated => ErrorCode::SimulationTerminated,
|
||||
ExecutionError::Timeout => ErrorCode::SimulationTimeout,
|
||||
ExecutionError::InvalidTargetTime(_) => ErrorCode::InvalidTime,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user