flutter_dotenv icon indicating copy to clipboard operation
flutter_dotenv copied to clipboard

`Exception`s should be thrown instead of `Error`s

Open britannio opened this issue 3 years ago • 2 comments

https://dart-lang.github.io/linter/lints/avoid_catching_errors.html

I'm trying to catch EmptyEnvFileError.

britannio avatar Jul 12 '21 14:07 britannio

Perhaps if the env fle you plan to use might be empty, you can check if its empty can catch that instead?

Actually I'm not really sure about the need for that error, would it be better to just treat empty files as an empty map?

ngxingyu avatar Jul 22 '21 23:07 ngxingyu

would it be better to just treat empty files as an empty map?

That's the behaviour I expected. The package doesn't perform actions that require the map to be non empty.

britannio avatar Jul 24 '21 13:07 britannio