feat: reject non-200 responses in hitta component with precise error
This commit is contained in:
@@ -33,6 +33,13 @@ impl Guest for Component {
|
|||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if first.status != 200 {
|
||||||
|
return Err(LookupError::ParseFailed(format!(
|
||||||
|
"unexpected HTTP status {}",
|
||||||
|
first.status
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
match parser::parse(&first.body) {
|
match parser::parse(&first.body) {
|
||||||
Ok(entry) => Ok(Entry {
|
Ok(entry) => Ok(Entry {
|
||||||
messages: entry.messages,
|
messages: entry.messages,
|
||||||
|
|||||||
Reference in New Issue
Block a user