Skip to main content

nominal_api_conjure/conjure/errors/scout/compute/api/
server_overloaded.rs

1/// The query was rejected because the compute backend is temporarily overloaded. This is a
2/// transient, load-shedding response that protects overall availability; the query itself is
3/// valid. Retry the request after a short delay using exponential backoff. INVALID_ARGUMENT
4/// (400) is used intentionally so clients do not auto-retry the request and amplify load —
5/// callers must implement their own backoff.
6#[derive(
7    Debug,
8    Clone,
9    conjure_object::serde::Serialize,
10    conjure_object::serde::Deserialize,
11    PartialEq,
12    Eq,
13    PartialOrd,
14    Ord,
15    Hash,
16    Copy
17)]
18#[serde(crate = "conjure_object::serde")]
19#[conjure_object::private::staged_builder::staged_builder]
20#[builder(crate = conjure_object::private::staged_builder, update, inline)]
21pub struct ServerOverloaded {
22    #[serde(rename = "queryId")]
23    query_id: conjure_object::Uuid,
24}
25impl ServerOverloaded {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(query_id: conjure_object::Uuid) -> Self {
29        Self::builder().query_id(query_id).build()
30    }
31    #[inline]
32    pub fn query_id(&self) -> conjure_object::Uuid {
33        self.query_id
34    }
35}
36impl conjure_error::ErrorType for ServerOverloaded {
37    #[inline]
38    fn code() -> conjure_error::ErrorCode {
39        conjure_error::ErrorCode::InvalidArgument
40    }
41    #[inline]
42    fn name() -> &'static str {
43        "Compute:ServerOverloaded"
44    }
45    #[inline]
46    fn safe_args() -> &'static [&'static str] {
47        &["queryId"]
48    }
49}