mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
rename Error::Image to Error::GenerateThumbnail
The previous error was nonspecific and, because of the '#[from]' annotation, could have been used accidentally for *any* errors from the image crate.
This commit is contained in:
parent
ed7f7b2461
commit
05043f97a0
2 changed files with 8 additions and 9 deletions
|
|
@ -276,10 +276,12 @@ impl Service {
|
|||
|
||||
t::debug!("Serializing thumbnail as PNG");
|
||||
let mut thumbnail_bytes = Vec::new();
|
||||
thumbnail.write_to(
|
||||
&mut Cursor::new(&mut thumbnail_bytes),
|
||||
image::ImageFormat::Png,
|
||||
)?;
|
||||
thumbnail
|
||||
.write_to(
|
||||
&mut Cursor::new(&mut thumbnail_bytes),
|
||||
image::ImageFormat::Png,
|
||||
)
|
||||
.map_err(Error::GenerateThumbnail)?;
|
||||
|
||||
Ok(Some(thumbnail_bytes))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,8 @@ pub(crate) enum Error {
|
|||
#[from]
|
||||
source: rocksdb::Error,
|
||||
},
|
||||
#[error("Could not generate an image.")]
|
||||
Image {
|
||||
#[from]
|
||||
source: image::error::ImageError,
|
||||
},
|
||||
#[error("Could not generate image thumbnail.")]
|
||||
GenerateThumbnail(#[source] image::error::ImageError),
|
||||
#[error("Could not connect to server: {source}")]
|
||||
Reqwest {
|
||||
#[from]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue