Merge pull request #75 from YoannMa/fixLog
fix bug when failing to get user's posts
This commit is contained in:
commit
0744caad6f
1 changed files with 3 additions and 3 deletions
|
@ -137,7 +137,7 @@ def get_user_posts_mastodon(userName, webserver):
|
||||||
try:
|
try:
|
||||||
user_id = get_user_id(webserver, userName)
|
user_id = get_user_id(webserver, userName)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log(f"Error getting user ID for user {user['acct']}: {ex}")
|
log(f"Error getting user ID for user {userName}: {ex}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -148,14 +148,14 @@ def get_user_posts_mastodon(userName, webserver):
|
||||||
return response.json()
|
return response.json()
|
||||||
elif response.status_code == 404:
|
elif response.status_code == 404:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"User {user['acct']} was not found on server {webserver}"
|
f"User {userName} was not found on server {webserver}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"Error getting URL {url}. Status code: {response.status_code}"
|
f"Error getting URL {url}. Status code: {response.status_code}"
|
||||||
)
|
)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
log(f"Error getting posts for user {user['acct']}: {ex}")
|
log(f"Error getting posts for user {userName}: {ex}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_user_posts_lemmy(userName, userUrl, webserver):
|
def get_user_posts_lemmy(userName, userUrl, webserver):
|
||||||
|
|
Loading…
Reference in a new issue