dotenv-kotlin icon indicating copy to clipboard operation
dotenv-kotlin copied to clipboard

Throw exception instead of return null when env var not found

Open cies opened this issue 6 months ago • 0 comments

It would be great if there could be an configuration option that makes dotenv throw and exception if an env var was not found.

Currently it returns null in those cases.

Alternatively (especially useful in Kotlin) there could be getOrNull and getOrThrow methods, where the last one returns a non-null String value.

cies avatar Jun 05 '25 08:06 cies