Skip to content

Change Declarative Configuration API to not throw exceptions #7929

@trask

Description

@trask

Change Declarative Configuration API to return null instead of throwing an exception on type mismatch.

E.g. for this YAML:

xyz: foo

this code:

DeclarativeConfigProperties.getBoolean("foo")

would return null instead of throwing an exception because of the type mismatch between the actual (string) and the expected (boolean).

Without this behavior, in the Java agent, we will need to either

  • wrap the Declarative Configuration API to changes this behavior, or
  • go through a fairly extensive change to ensure we're only reading configuration at startup and not at runtime, to make sure that we only fail at startup and never fail at runtime

While the second option may be a good change anyways, I think our current usage isn't too atypical of how people could be reading configuration at runtime in library instrumentation as well, and points to the dangers of throwing an exception from these APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions