Skip to content

Commit db1036d

Browse files
mwilliammyersKodrAus
authored andcommitted
Add ApiError::IllegalArgument enum variant
1 parent 2dcf229 commit db1036d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/responses/src/error.rs

+12
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ quick_error! {
160160
description("parsing failed")
161161
display("parsing failed: '{}'", reason)
162162
}
163+
/** There was an illegal argument in the request. */
164+
IllegalArgument { reason: String } {
165+
description("illegal argument")
166+
display("illegal argument: '{}'", reason)
167+
}
163168
#[doc(hidden)]
164169
__NonExhaustive {}
165170
}
@@ -247,6 +252,13 @@ impl From<Map<String, Value>> for ParsedApiError {
247252
reason: reason.into(),
248253
})
249254
}
255+
"illegal_argument_exception" => {
256+
let reason = error_key!(obj[reason]: |v| v.as_str());
257+
258+
ParsedApiError::Known(ApiError::IllegalArgument {
259+
reason: reason.into(),
260+
})
261+
}
250262
_ => ParsedApiError::Unknown(obj),
251263
}
252264
}

0 commit comments

Comments
 (0)