fix: update payload_too_large error message to include human readable maximum acceptable payload size

This commit is contained in:
Filip Bachul 2023-05-09 20:00:03 +02:00
parent ad5f25d880
commit 3064ea6495
3 changed files with 8 additions and 5 deletions

View file

@ -59,7 +59,9 @@ impl Stream for Payload {
self.limit = new_limit;
Poll::Ready(Some(Ok(bytes)))
}
None => Poll::Ready(Some(Err(MeilisearchHttpError::PayloadTooLarge))),
None => {
Poll::Ready(Some(Err(MeilisearchHttpError::PayloadTooLarge(self.limit))))
}
},
x => Poll::Ready(Some(x.map_err(MeilisearchHttpError::from))),
},