Skip to content

Commit 94e5022

Browse files
error handling
1 parent bf2b2cf commit 94e5022

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
@@ -282,10 +282,17 @@ where
282282
)));
283283
}
284284
}
285+
} else {
286+
return Err(PostError::Invalid(anyhow::anyhow!(
287+
"Unsupported Content-Type: {}. Expected application/json or application/x-protobuf",
288+
content_type
289+
)));
285290
}
286291
}
287292
None => {
288-
return Err(PostError::Header(ParseHeaderError::InvalidValue));
293+
return Err(PostError::Invalid(anyhow::anyhow!(
294+
"Missing Content-Type header. Expected application/json or application/x-protobuf"
295+
)));
289296
}
290297
}
291298

0 commit comments

Comments
 (0)