Git Product home page Git Product logo

Comments (8)

msinn avatar msinn commented on May 27, 2024

Fixed Bug 'Scheduler starting too soon'.

Please Test

from smarthome.

msinn avatar msinn commented on May 27, 2024

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.

onkelandy avatar onkelandy commented on May 27, 2024

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.

msinn avatar msinn commented on May 27, 2024

Please elaborate. I don`t understand the problem you are having. Please post the part of your log file.

from smarthome.

onkelandy avatar onkelandy commented on May 27, 2024

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.

msinn avatar msinn commented on May 27, 2024

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.

onkelandy avatar onkelandy commented on May 27, 2024

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.

msinn avatar msinn commented on May 27, 2024

Nach der Rückmeldung mach ich hier zu. 😄

from smarthome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.