Use more descriptive exceptions in moztelemetry

NEW
Unassigned

Status

P2
normal
a year ago
a year ago

People

(Reporter: sunahsuh, Unassigned)

Tracking

Details

The particular issue that prompted this bug is that specifying a bad histogram name in `get_pings_properties` throws a KeyError:
  File "/mnt/anaconda2/lib/python2.7/site-packages/moztelemetry/histogram.py", line 135, in __init__
    name, histograms_definition[re.sub("^STARTUP_", "", proper_name)])
KeyError: 'NETWORK_RACE_CACHE_WITH_NETWORK_USAGE'

In this specific case, we should throw a custom exception with a better error message specifies exactly what happened ("Histogram <name> does not exist").

I'm sure there are a few other places in moztelemetry where we could provide better error messages to the end user as well.
You need to log in before you can comment on or make changes to this bug.