Skip to content

Conversation

CORDEA
Copy link
Contributor

@CORDEA CORDEA commented Jan 2, 2024

Hi, thank you for this awesome package!

As a user, I'd like to apply a small improvement to make the error more understandable. CompressError doesn't currently have toString, so unless a logger or similar explicitly reads the #message, the content may be unclear. For example,

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'CompressError'
#0      FlutterImageCompressCommon.compressAndGetFile (package:flutter_image_compress_common/flutter_image_compress_common.dart:167:7)
#1      FlutterImageCompress.compressAndGetFile (package:flutter_image_compress/flutter_image_compress.dart:105:22)

After applying this patch.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CompressError: numberOfRetries can't be null or less than 0
#0      FlutterImageCompressCommon.compressAndGetFile (package:flutter_image_compress_common/flutter_image_compress_common.dart:167:7)
#1      FlutterImageCompress.compressAndGetFile (package:flutter_image_compress/flutter_image_compress.dart:105:22)

Could you please consider if it can be merged?

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution

@AlexV525 AlexV525 merged commit 1df7197 into fluttercandies:main Mar 8, 2024
@CORDEA CORDEA deleted the feature/compress-error-to-string branch March 8, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants