summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChih-Yu Huang <akahuang@google.com>2022-04-04 17:51:21 +0900
committerChih-Yu Huang <akahuang@google.com>2022-04-06 15:58:56 +0900
commitf1d7abd4b9c4ac426cbe4d24721e177a076a68a8 (patch)
treefeb24e9c360c2181821e37ed3ad5a32f7703185f /src
parenta964b9ba3d93b396c606f3dbb4152bd195a42518 (diff)
downloaduwb-f1d7abd4b9c4ac426cbe4d24721e177a076a68a8.tar.gz
uwb_core: add StatusCode
This CL adds a StatusCode enum, and adds it as one kind of UciError. The StatusCode is the same as the one at the UCI specification. Bug: 227264247 Test: cargo test -p uwb_core Change-Id: Ia8f2e6629abe53887f30b955eff663fd96e249f5
Diffstat (limited to 'src')
-rw-r--r--src/rust/uwb_core/src/uci/error.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rust/uwb_core/src/uci/error.rs b/src/rust/uwb_core/src/uci/error.rs
index 4e9849b..a0d7e2f 100644
--- a/src/rust/uwb_core/src/uci/error.rs
+++ b/src/rust/uwb_core/src/uci/error.rs
@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+pub use uwb_uci_packets::StatusCode;
+
/// The error code for UCI module.
#[derive(Debug, thiserror::Error)]
pub enum UciError {
@@ -29,5 +31,8 @@ pub enum UciError {
Specialize(Vec<u8>),
#[error("Invalid args")]
InvalidArgs,
+ #[error("Error UCI status code: {0:?}")]
+ Status(StatusCode),
}
+
pub type UciResult<T> = Result<T, UciError>;