Thanks to visit codestin.com
Credit goes to github.com

Skip to content

error message humanization #40

@532910

Description

@532910

If co2mond has never beed runned and CntR/Tamb are absent it gives could not convert string to float instead of clean error message:

% cat /etc/collectd/collectd.conf.d/co2mon.conf 
LoadPlugin python
<Plugin python>
	ModulePath "/home/sergio/co2mon/graph/collectd"
	LogTraces true
	Interactive false
	Import "co2mon"
</Plugin>
collectd: Unhandled python exception in read callback: ValueError: could not convert string to float: 
collectd: Traceback (most recent call last):
collectd:   File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 26, in read_callback#012    co2 = [read_metric('CntR')]
collectd:   File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 12, in read_metric#012    return float(v)
collectd: ValueError: could not convert string to float: 
collectd: read-function of plugin `python.co2mon' failed. Will suspend it for 40.000 seconds.
collectd: Unhandled python exception in read callback: ValueError: could not convert string to float: 
collectd: Traceback (most recent call last):
collectd:   File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 26, in read_callback#012    co2 = [read_metric('CntR')]
collectd:   File "/home/sergio/co2mon/graph/collectd/co2mon.py", line 12, in read_metric#012    return float(v)
collectd: ValueError: could not convert string to float: 
collectd: read-function of plugin `python.co2mon' failed. Will suspend it for 80.000 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions