bitwarden_test/play/error.rs
1//! Error types for the Play test framework
2
3use thiserror::Error;
4
5/// Errors that can occur during Play framework operations
6#[derive(Debug, Error)]
7pub enum PlayError {
8 /// HTTP request failed
9 #[error("HTTP request failed: {0}")]
10 Http(#[from] reqwest::Error),
11
12 /// JSON serialization/deserialization failed
13 #[error("JSON error: {0}")]
14 Json(#[from] serde_json::Error),
15
16 /// Server returned an error response
17 #[error("Server error [{status}]: {body}")]
18 ServerError {
19 /// HTTP status code
20 status: u16,
21 /// Response body
22 body: String,
23 },
24}
25
26/// Result type for Play framework operations
27pub type PlayResult<T> = Result<T, PlayError>;