diff options
| author | Matthieu <matthieu@developershouse.xyz> | 2021-09-19 18:12:41 +0400 |
|---|---|---|
| committer | Matthieu <matthieu@developershouse.xyz> | 2021-09-19 18:12:41 +0400 |
| commit | 6d3caebc79f340d26262adc2ba789b10da4108aa (patch) | |
| tree | 208e1bfe0cf036c0561555e0fc35beabfd261375 /gateway/src/error.rs | |
| parent | 88300c45202a228d54c1e99dd3b295ef3fb9aabd (diff) | |
shard + implementation of the payload deserialization & restructure
Diffstat (limited to 'gateway/src/error.rs')
| -rw-r--r-- | gateway/src/error.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gateway/src/error.rs b/gateway/src/error.rs new file mode 100644 index 0000000..603caab --- /dev/null +++ b/gateway/src/error.rs @@ -0,0 +1,24 @@ +use common::error::NovaError; + +#[derive(Debug)] +pub struct GatewayError(NovaError); + +impl From<tokio_tungstenite::tungstenite::Error> for GatewayError { + fn from(e: tokio_tungstenite::tungstenite::Error) -> Self { + GatewayError { + 0: NovaError { + message: e.to_string(), + }, + } + } +} + +impl From<String> for GatewayError { + fn from(e: String) -> Self { + GatewayError { + 0: NovaError { + message: e, + }, + } + } +} |
