Skip to main content

ory_kratos_client/models/
generic_error.rs

1/*
2 * Ory Identities API
3 *
4 * This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more. 
5 *
6 * The version of the OpenAPI document: v26.2.0
7 * Contact: office@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GenericError {
16    /// The status code
17    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
18    pub code: Option<i64>,
19    /// Debug information  This field is often not exposed to protect against leaking sensitive information.
20    #[serde(rename = "debug", skip_serializing_if = "Option::is_none")]
21    pub debug: Option<String>,
22    /// Further error details
23    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
24    pub details: Option<serde_json::Value>,
25    /// The error ID  Useful when trying to identify various errors in application logic.
26    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
27    pub id: Option<String>,
28    /// Error message  The error's message.
29    #[serde(rename = "message")]
30    pub message: String,
31    /// A human-readable reason for the error
32    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
33    pub reason: Option<String>,
34    /// The request ID  The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID.
35    #[serde(rename = "request", skip_serializing_if = "Option::is_none")]
36    pub request: Option<String>,
37    /// The status description
38    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
39    pub status: Option<String>,
40}
41
42impl GenericError {
43    pub fn new(message: String) -> GenericError {
44        GenericError {
45            code: None,
46            debug: None,
47            details: None,
48            id: None,
49            message,
50            reason: None,
51            request: None,
52            status: None,
53        }
54    }
55}
56