mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-07 09:40:11 +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)
|
||||
checkNotNull(input) { "Unable to read file(path=${this.path}), no ImageInputStream found" }
|
||||
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
|
||||
|
||||
return ExternalImage(
|
||||
|
Loading…
Reference in New Issue
Block a user