awslabs / awslabs/aws-embedded-metrics-python

Improve Error Handling

Open
#22 3 comments 1 reaction 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
231
Forks
44
PR merge metrics
No merged PRs in 30d

Description

## Problem

There are a few places within the package where logical/configuration errors are swallowed silently (see #19 for one example). We should add a configuration parameter that allows developers to throw validation exceptions in these cases. The original reason for not throwing exceptions was the idea that a monitoring tool shouldn't negatively impact the application. It would be possible that throwing exceptions in these cases would cause applications to crash at runtime. However, this should be weighed against the behavior today which arguably violates the principle of least astonishment. The current behavior is not clear from the interface design.

## Next Steps

- Enumerate all the places where this is an issue.
- Add configuration parameter `THROW_ON_VALIDATION_ERRORS` (or better name?) that defaults to false.
- Accept comments on whether or not the default behavior should be changed to throw which would go out in the next major version.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.