Skip to content

Commit

Permalink
Merge pull request #111 from jackbackes/fix-structured-error-in-response
Browse files Browse the repository at this point in the history
Fix for structured error message
  • Loading branch information
dongri authored Sep 23, 2024
2 parents 6f1e779 + 48757f9 commit 597d787
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/v1/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ impl_builder_methods!(
metadata: HashMap<String, String>
);

#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct LastError {
pub code: String,
pub message: String,
}

#[derive(Debug, Deserialize, Serialize)]
pub struct RunObject {
pub id: String,
Expand All @@ -76,7 +82,7 @@ pub struct RunObject {
#[serde(skip_serializing_if = "Option::is_none")]
pub required_action: Option<HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error: Option<String>,
pub last_error: Option<LastError>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -132,7 +138,7 @@ pub struct RunStepObject {
pub status: String,
pub step_details: HashMap<String, String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error: Option<String>,
pub last_error: Option<LastError>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 597d787

Please sign in to comment.