Added error in response

main
Joey Hines 2024-06-22 15:20:44 -06:00
parent 8a832b6311
commit 994aa23ae0
No known key found for this signature in database
GPG Key ID: 995E531F7A569DDB
5 changed files with 22 additions and 2 deletions

2
Cargo.lock generated
View File

@ -619,7 +619,7 @@ dependencies = [
[[package]]
name = "raas_types"
version = "0.0.8"
version = "0.0.9"
dependencies = [
"bytes",
"prost",

View File

@ -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"]

14
src/error.proto 100644
View File

@ -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;
}

View File

@ -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,

View File

@ -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;
}
}