fix(translate): handle RuntimeException in TranslateService initialization
This commit is contained in:
parent
63ae26cb55
commit
c09f5dda62
|
@ -50,13 +50,13 @@ public interface TranslateService<T extends Language> {
|
|||
List<TranslateService<?>> result = new LinkedList<>();
|
||||
try {
|
||||
result.add(GoogleTranslateService.get());
|
||||
} catch (URISyntaxException | IOException e) {
|
||||
} catch (URISyntaxException | IOException | RuntimeException e) {
|
||||
LibJf.LOGGER.error("Could not create Google Translate service", e);
|
||||
}
|
||||
if (TranslateConfig.libreTranslateHost != null) {
|
||||
try {
|
||||
result.add(LibreTranslateService.get(TranslateConfig.libreTranslateHost));
|
||||
} catch (TranslateException e) {
|
||||
} catch (TranslateException | RuntimeException e) {
|
||||
LibJf.LOGGER.error("Could not create LibreTranslate service", e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue