tonic_richer_error/
error_details_vec.rs1use super::std_messages::*;
2
3#[derive(Clone, Debug)]
6pub enum ErrorDetail {
7 RetryInfo(RetryInfo),
9
10 DebugInfo(DebugInfo),
12
13 QuotaFailure(QuotaFailure),
15
16 ErrorInfo(ErrorInfo),
18
19 PreconditionFailure(PreconditionFailure),
21
22 BadRequest(BadRequest),
24
25 RequestInfo(RequestInfo),
27
28 ResourceInfo(ResourceInfo),
30
31 Help(Help),
33
34 LocalizedMessage(LocalizedMessage),
36}
37
38impl From<RetryInfo> for ErrorDetail {
39 fn from(err_detail: RetryInfo) -> Self {
40 ErrorDetail::RetryInfo(err_detail)
41 }
42}
43
44impl From<DebugInfo> for ErrorDetail {
45 fn from(err_detail: DebugInfo) -> Self {
46 ErrorDetail::DebugInfo(err_detail)
47 }
48}
49
50impl From<QuotaFailure> for ErrorDetail {
51 fn from(err_detail: QuotaFailure) -> Self {
52 ErrorDetail::QuotaFailure(err_detail)
53 }
54}
55
56impl From<ErrorInfo> for ErrorDetail {
57 fn from(err_detail: ErrorInfo) -> Self {
58 ErrorDetail::ErrorInfo(err_detail)
59 }
60}
61
62impl From<PreconditionFailure> for ErrorDetail {
63 fn from(err_detail: PreconditionFailure) -> Self {
64 ErrorDetail::PreconditionFailure(err_detail)
65 }
66}
67
68impl From<BadRequest> for ErrorDetail {
69 fn from(err_detail: BadRequest) -> Self {
70 ErrorDetail::BadRequest(err_detail)
71 }
72}
73
74impl From<RequestInfo> for ErrorDetail {
75 fn from(err_detail: RequestInfo) -> Self {
76 ErrorDetail::RequestInfo(err_detail)
77 }
78}
79
80impl From<ResourceInfo> for ErrorDetail {
81 fn from(err_detail: ResourceInfo) -> Self {
82 ErrorDetail::ResourceInfo(err_detail)
83 }
84}
85
86impl From<Help> for ErrorDetail {
87 fn from(err_detail: Help) -> Self {
88 ErrorDetail::Help(err_detail)
89 }
90}
91
92impl From<LocalizedMessage> for ErrorDetail {
93 fn from(err_detail: LocalizedMessage) -> Self {
94 ErrorDetail::LocalizedMessage(err_detail)
95 }
96}