add more debug data
This commit is contained in:
parent
43b426212c
commit
ce95bbe185
1 changed files with 4 additions and 1 deletions
|
@ -50,6 +50,7 @@ class MastodonEmailBridge:
|
|||
'.mastodon_email_bridge_sent_items.db'
|
||||
)
|
||||
self._init_log()
|
||||
self.last_translation_response = None
|
||||
self._get_sent_posts()
|
||||
if 'templates_folder' in self.config:
|
||||
templates_folder=self.config['templates_folder']
|
||||
|
@ -284,6 +285,7 @@ class MastodonEmailBridge:
|
|||
data[field],
|
||||
source_language=source_language
|
||||
)
|
||||
new_data[f"translated_{field}_response"] = self.last_translation_response
|
||||
self._log.debug(
|
||||
"Total of %s fields translated",
|
||||
counter
|
||||
|
@ -307,7 +309,8 @@ class MastodonEmailBridge:
|
|||
data=data,
|
||||
)
|
||||
try:
|
||||
translation = response.json()['translatedText']
|
||||
self.last_translation_response = response.json()
|
||||
translation = self.last_translation_response['translatedText']
|
||||
except Exception as error:
|
||||
self._log.error(
|
||||
"Error translating '%s' from '%s' to '%s'. %s. Response content: %s",
|
||||
|
|
Loading…
Reference in a new issue