mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-09 19:50:27 +08:00
Add detailed exception prompt
This commit is contained in:
parent
197bf2e2dd
commit
32b1decd0d
@ -65,7 +65,7 @@ fun File.toExternalImage(): ExternalImage {
|
|||||||
val input = ImageIO.createImageInputStream(this)
|
val input = ImageIO.createImageInputStream(this)
|
||||||
checkNotNull(input) { "Unable to read file(path=${this.path}), no ImageInputStream found" }
|
checkNotNull(input) { "Unable to read file(path=${this.path}), no ImageInputStream found" }
|
||||||
val image = ImageIO.getImageReaders(input).asSequence().firstOrNull()
|
val image = ImageIO.getImageReaders(input).asSequence().firstOrNull()
|
||||||
?: error("Unable to read file(path=${this.path}), no ImageReader found")
|
?: error("Unable to read file(path=${this.path}), no ImageReader found (file type not supported)")
|
||||||
image.input = input
|
image.input = input
|
||||||
|
|
||||||
return ExternalImage(
|
return ExternalImage(
|
||||||
|
Loading…
Reference in New Issue
Block a user