Skip to content

Error when the variable referenced with envvar() doesn't exist #336

@michaeltlombardi

Description

@michaeltlombardi

Summary of the new feature / enhancement

As a user, I want my configuration to error when referencing an environment variable that doesn't exist instead of receiving an empty string and unpredictable behavior for my configuration.

Currently, the envvar() function returns an empty string when the referenced variable doesn't exist. This may be desirable, but it may also lead to other issues with the configuration.

Proposed technical implementation details (optional)

The envvar() function should either:

  1. Always error when the referenced variable doesn't exist, or
  2. Error by default, but have an optional second boolean parameter that indicates whether it should return an empty string if the variable doesn't exist.

In the latter case, this would enable some flexibility for users while defaulting to a stricter behavior.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions