fix(translate): handle RuntimeException in TranslateService initialization
ci/woodpecker/push/docs Pipeline was successful Details
ci/woodpecker/push/jfmod Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2024-02-22 20:22:02 +01:00
parent 63ae26cb55
commit c09f5dda62
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}