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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use actix::MailboxError;
use std::io;
use tokio::timer;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("internal gWasm API error: {0}")]
MailboxError(#[from] MailboxError),
#[error("internal gWasm API error: {0}")]
TimerError(#[from] timer::Error),
#[error("internal gWasm API error: {0}")]
IOError(#[from] io::Error),
#[error("internal Golem error: {0}")]
WampError(actix_wamp::Error),
#[error("internal Golem error: {0}")]
GolemRPCError(golem_rpc_api::Error),
#[error("received Ctrl-C interrupt")]
KeyboardInterrupt(tokio_ctrlc_error::KeyboardInterrupt),
#[error("internal gWasm API error: {0}")]
CtrlcError(tokio_ctrlc_error::IoError),
#[error("error parsing Timeout value: {0}")]
ChronoError(#[from] chrono::ParseError),
#[error("zero timeout \"00:00:00\" is forbidden")]
ZeroTimeoutError,
#[error("empty TaskInfo received from Golem")]
EmptyTaskInfo,
#[error("empty progress in TaskInfo")]
EmptyProgress,
#[error("task aborted externally")]
TaskAborted,
#[error("task timed out")]
TaskTimedOut,
}
impl From<actix_wamp::Error> for Error {
fn from(err: actix_wamp::Error) -> Self {
Error::WampError(err)
}
}
impl From<golem_rpc_api::Error> for Error {
fn from(err: golem_rpc_api::Error) -> Self {
Error::GolemRPCError(err)
}
}
impl From<tokio_ctrlc_error::IoError> for Error {
fn from(err: tokio_ctrlc_error::IoError) -> Self {
Error::CtrlcError(err)
}
}
impl From<tokio_ctrlc_error::KeyboardInterrupt> for Error {
fn from(err: tokio_ctrlc_error::KeyboardInterrupt) -> Self {
Error::KeyboardInterrupt(err)
}
}