Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update load exception logging #128

Merged
merged 2 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ovos_plugin_manager/coreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def create(config=None):
clazz = OVOSCoreferenceSolverFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'CoreferenceSolver plugin {plugin} could not be loaded!')
LOG.exception(f'CoreferenceSolver plugin {plugin} '
f'could not be loaded!')
raise


Expand Down
3 changes: 2 additions & 1 deletion ovos_plugin_manager/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def create(config=None):
clazz = OVOSKeywordExtractorFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'Keyword extraction plugin {plugin} could not be loaded!')
LOG.exception(f'Keyword extraction plugin {plugin} '
f'could not be loaded!')
return KeywordExtractor()


Expand Down
10 changes: 5 additions & 5 deletions ovos_plugin_manager/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def extract_stream(self, uri, video=True):
return meta or {"uri": uri}


if __name__ == "__main__":
s = StreamHandler()
print(s.supported_seis)
# ['rss', 'bandcamp', 'youtube', 'ydl', 'youtube.channel.live',
# 'pytube', 'invidious', 'm3u', 'pls']
# if __name__ == "__main__":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s going on here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old test code; I commented out when troubleshooting extra OCP init but it wasn't related. I can replace this if wanted

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure it wasn’t functional code deactivated by mistake. Only reason to remove it this instant would be if you think it’ll be hard to spot in a cleanup pass.

# s = StreamHandler()
# print(s.supported_seis)
# # ['rss', 'bandcamp', 'youtube', 'ydl', 'youtube.channel.live',
# # 'pytube', 'invidious', 'm3u', 'pls']
2 changes: 1 addition & 1 deletion ovos_plugin_manager/postag.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def create(config=None):
clazz = OVOSPosTaggerFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'Postag plugin {plugin} could not be loaded!')
LOG.exception(f'Postag plugin {plugin} could not be loaded!')
return PosTagger()


Expand Down
3 changes: 2 additions & 1 deletion ovos_plugin_manager/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def create(config=None):
clazz = OVOSUtteranceSegmenterFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'Utterance Segmentation plugin {plugin} could not be loaded!')
LOG.exception(f'Utterance Segmentation plugin {plugin} '
f'could not be loaded!')
return Segmenter()


Expand Down
2 changes: 1 addition & 1 deletion ovos_plugin_manager/tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def create(config=None):
clazz = OVOSTokenizerFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'Tokenizer plugin {plugin} could not be loaded!')
LOG.exception(f'Tokenizer plugin {plugin} could not be loaded!')
return Tokenizer()


Expand Down
2 changes: 1 addition & 1 deletion ovos_plugin_manager/vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def create(config=None):
clazz = OVOSVADFactory.get_class(config)
return clazz(plugin_config)
except Exception:
LOG.error(f'VAD plugin {plugin} could not be loaded!')
LOG.exception(f'VAD plugin {plugin} could not be loaded!')
raise


Expand Down
3 changes: 2 additions & 1 deletion ovos_plugin_manager/wakewords.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ def create_hotword(cls, hotword="hey mycroft", config=None,
module = ww_config.get("module", "pocketsphinx")
try:
return cls.load_module(module, hotword, ww_config, lang, loop)
except:
except Exception as e:
LOG.error(f"Failed to load hotword: {hotword} - {module}")
LOG.exception(e)
fallback_ww = ww_config.get("fallback_ww")
if fallback_ww in ww_configs and fallback_ww != hotword:
LOG.info(f"Attempting to load fallback ww instead: {fallback_ww}")
Expand Down