fixed wrong exception #87

Closed
opened 2019-06-10 09:49:46 +00:00 by b3yond · 2 comments

Author: @b3yond Posted at: 19.02.2019 15:28

Fixes the following error:

Shutdown.                                                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                 
  File "backend.py", line 40, in <module>                                                                                                                                                                          
    bot2.post(user, status)                                                                                                                                                                                        
  File "/srv/ticketfrei/active_bots/twitterbot.py", line 75, in post                                                                                                                                               
    api = self.get_api(user)                                                                                                                                                                                       
  File "/srv/ticketfrei/active_bots/twitterbot.py", line 18, in get_api                                                                                                                                            
    keys = user.get_twitter_credentials()                                                                                                                                                                          
  File "/srv/ticketfrei/user.py", line 295, in get_twitter_credentials                                                                                                                                             
    keys.append(row[0])                                                                                                                                                                                            
TypeError: 'NoneType' object is not subscriptable                                                                                                                                                                  

It's basically the same exception as in line 35, but apparently I confused a TypeError for an IndexError when applying the same solution to post() as I applied in crawl(). Wouldn't have happened with copy-paste.

Author: @b3yond Posted at: 19.02.2019 15:28 Fixes the following error: ``` Shutdown. Traceback (most recent call last): File "backend.py", line 40, in <module> bot2.post(user, status) File "/srv/ticketfrei/active_bots/twitterbot.py", line 75, in post api = self.get_api(user) File "/srv/ticketfrei/active_bots/twitterbot.py", line 18, in get_api keys = user.get_twitter_credentials() File "/srv/ticketfrei/user.py", line 295, in get_twitter_credentials keys.append(row[0]) TypeError: 'NoneType' object is not subscriptable ``` It's basically the same exception as in line 35, but apparently I confused a TypeError for an IndexError when applying the same solution to post() as I applied in crawl(). Wouldn't have happened with copy-paste.
Poster
Owner

Author: @b3yond Posted at: 19.02.2019 15:36

To test:

  1. create a Ticketfrei account
  2. login with mastodon
  3. write a report via mastodon
  4. look if traceback appears in backend.log
Author: @b3yond Posted at: 19.02.2019 15:36 To test: 1. create a Ticketfrei account 2. login with mastodon 3. write a report via mastodon 4. look if traceback appears in backend.log
Poster
Owner

Author: @git-sid Posted at: 19.02.2019 15:48

Looks like an easy fix that can be merged.

Author: @git-sid Posted at: 19.02.2019 15:48 Looks like an easy fix that can be merged.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: b3yond/ticketfrei#87
There is no content yet.