diff --git a/weboob/applications/wetboobs/wetboobs.py b/weboob/applications/wetboobs/wetboobs.py index a4f7ff75..25e1f83f 100644 --- a/weboob/applications/wetboobs/wetboobs.py +++ b/weboob/applications/wetboobs/wetboobs.py @@ -19,10 +19,11 @@ from weboob.capabilities.weather import ICapWeather -from weboob.capabilities.gauge import ICapGauge +from weboob.capabilities.gauge import ICapGauge, SensorNotFound from weboob.tools.application.repl import ReplApplication from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter +import sys __all__ = ['WetBoobs'] @@ -92,6 +93,13 @@ class WetBoobs(ReplApplication): if len(args) == 2: return self._complete_object() + def bcall_error_handler(self, backend, error, backtrace): + if isinstance(error, SensorNotFound): + msg = unicode(error) or 'Sensor not found (hint: try sensors command)' + print >>sys.stderr, 'Error(%s): %s' % (backend.name, msg) + else: + return ReplApplication.bcall_error_handler(self, backend, error, backtrace) + def do_current(self, line): """ current CITY_ID