Skip to content

Commit b582d9d

Browse files
error handling
1 parent 6f21cba commit b582d9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/handlers/http/ingest.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,17 @@ where
291291
)));
292292
}
293293
}
294+
} else {
295+
return Err(PostError::Invalid(anyhow::anyhow!(
296+
"Unsupported Content-Type: {}. Expected application/json or application/x-protobuf",
297+
content_type
298+
)));
294299
}
295300
}
296301
None => {
297-
return Err(PostError::Header(ParseHeaderError::InvalidValue));
302+
return Err(PostError::Invalid(anyhow::anyhow!(
303+
"Missing Content-Type header. Expected application/json or application/x-protobuf"
304+
)));
298305
}
299306
}
300307

0 commit comments

Comments
 (0)