Skip to content

Commit 48757f9

Browse files
author
Jack Backes
committed
Fix for structured error message
1 parent 6f1e779 commit 48757f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/v1/run.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ impl_builder_methods!(
6565
metadata: HashMap<String, String>
6666
);
6767

68+
#[derive(Debug, Deserialize, Serialize, Clone)]
69+
pub struct LastError {
70+
pub code: String,
71+
pub message: String,
72+
}
73+
6874
#[derive(Debug, Deserialize, Serialize)]
6975
pub struct RunObject {
7076
pub id: String,
@@ -76,7 +82,7 @@ pub struct RunObject {
7682
#[serde(skip_serializing_if = "Option::is_none")]
7783
pub required_action: Option<HashMap<String, String>>,
7884
#[serde(skip_serializing_if = "Option::is_none")]
79-
pub last_error: Option<String>,
85+
pub last_error: Option<LastError>,
8086
#[serde(skip_serializing_if = "Option::is_none")]
8187
pub expires_at: Option<i64>,
8288
#[serde(skip_serializing_if = "Option::is_none")]
@@ -132,7 +138,7 @@ pub struct RunStepObject {
132138
pub status: String,
133139
pub step_details: HashMap<String, String>,
134140
#[serde(skip_serializing_if = "Option::is_none")]
135-
pub last_error: Option<String>,
141+
pub last_error: Option<LastError>,
136142
#[serde(skip_serializing_if = "Option::is_none")]
137143
pub expires_at: Option<i64>,
138144
#[serde(skip_serializing_if = "Option::is_none")]

0 commit comments

Comments
 (0)