diff --git a/Cargo.lock b/Cargo.lock index 079a811..e07d6b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,7 +619,7 @@ dependencies = [ [[package]] name = "raas_types" -version = "0.0.8" +version = "0.0.9" dependencies = [ "bytes", "prost", diff --git a/Cargo.toml b/Cargo.toml index 18689ac..fc490df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raas_types" -version = "0.0.8" +version = "0.0.9" edition = "2021" description = "Protobuf definitions for RaaS" authors = ["Joey Hines joey@ahines.net"] diff --git a/src/error.proto b/src/error.proto new file mode 100644 index 0000000..8e444ee --- /dev/null +++ b/src/error.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package raas.error; + +enum ErrorType { + RobotError = 0; + NoRobotsToHandleRequest = 1; + RobotOffline = 2; +} + +message Error { + ErrorType err = 1; + string msg = 2; +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 51ccce5..c8eccd3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,6 +28,10 @@ pub mod raas { include!(concat!(env!("OUT_DIR"), "/raas.resp.rs")); } + pub mod error { + include!(concat!(env!("OUT_DIR"), "/raas.error.rs")); + } + #[derive(Debug, Clone)] pub struct RaasMessage { pub len: u32, diff --git a/src/resp.proto b/src/resp.proto index d0ee9df..656a83a 100644 --- a/src/resp.proto +++ b/src/resp.proto @@ -1,6 +1,7 @@ syntax = "proto3"; import "roll.proto"; +import "error.proto"; package raas.resp; @@ -9,5 +10,6 @@ message Response { uint64 timestamp = 2; oneof resp { raas.bot.roll.RollResponse roll_resp = 3; + raas.error.Error error = 4; } } \ No newline at end of file