Comments (8)
Fixed Bug 'Scheduler starting too soon'.
Please Test
from smarthome.
About: IMAP: problem parsing message b'3428': 'NoneType' object is not subscriptable
Using 'except' instead of 'except Exception as e' does nothing to the error but hiding it. Because the variable e is not set, the following instruction
logger.exception("IMAP: problem parsing message {}: {}".format(uid, e))
fails.
Why would you hide an error that is occurring in the communication with the mail server anyway?
from smarthome.
It's not about hiding the exception, it's about catching all problems.
Implementing a line like this gets the error message written in the log:
except: # catch all exceptions
e = sys.exc_info()[0]
That should avoid the problem that python shows some error messages - and redirect the message to the log output
from smarthome.
Please elaborate. I don`t understand the problem you are having. Please post the part of your log file.
from smarthome.
I have no idea what really causes the error but right now it is not correctly caught by the python code. The log looks like this (so first line is smarthome log, rest is python error):
2016-07-11 15:01:33 ERROR IMAP IMAP: problem parsing message b'3406': 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/usr/smarthome/plugins/mail/init.py", line 88, in _cycle
mail = email.message_from_bytes(data[0][1])
TypeError: 'NoneType' object is not subscriptable
from smarthome.
The exception is correctly caught. The author of the plugin wanted to throw an exception. The call to logger.exception() does exact this:
logger.exception("IMAP: problem parsing message {}: {}".format(uid, e))
This way the user can see which line of the try/except block causes the error.
So this is not a bug. It works as designed. It could be debated, if this design user friendly.
from smarthome.
Ohhhh okay, got it.. thanks - didn't know that the "execption" part was the "problem" ;)
So this can be marked as fixed as the newest version doesn't have the "alive" problem anymore. Thanks!
from smarthome.
Nach der Rückmeldung mach ich hier zu. 😄
from smarthome.
Related Issues (20)
- Admin interface: support new log levels HOT 1
- HTTP Module: improve handling of page length and responsive design HOT 2
- CherryPy ValueError on restart HOT 2
- cache value not converted to current item type
- Issues with (re)loading logics from the editor page of the admin gui HOT 7
- structs not checked for wrong configurations? HOT 1
- Issue with smartdeviceplugin with UTF-8 response HOT 1
- Requirements von Logiken und Userfunctions installieren beim Start? HOT 7
- Websocket crashed HOT 4
- Vorschlag zum besseren Handling von Items mit Datentyp 'dict' oder 'list' HOT 25
- Websocket Exceptions HOT 4
- struct names are applied to items including the struct
- Visu subscription of a memory log activates sending of env.core.log HOT 5
- smarthome/doc/user/source/beispiele/eval.rst Beispiel "Enumeration über Liste" funktioniert nicht HOT 1
- Log configuration: allow placeholders for filename and rotate correctly HOT 1
- Delay in scenes HOT 4
- Problem when Item has the same name as a class Item method HOT 5
- Http module cannot bind on all interfaces
- Incompability to paho-mqtt-2.0.0 HOT 1
- Usage of logging.default.yaml HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarthome.