mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-29 00:17:13 +09:00
.
This commit is contained in:
1 parent
0c62911ffb
commit
98d664e85a
1 file changed
+4
-1
+4
-1
@@ -24,9 +24,12 @@ class LibreTranslateAPI {
|
||||
|
||||
async init() {
|
||||
try {
|
||||
this.allowedLanguages = (await this.handleResponse(await fetch(`${this.url}languages?api_key=${this.apiKey}`, {method: 'GET'})))?.[0]?.targets || [];
|
||||
this.allowedLanguages = (await this.handleResponse(
|
||||
await fetch(`${this.url}languages?api_key=${this.apiKey}`, {method: 'GET'})
|
||||
))?.[0]?.targets || [];
|
||||
} catch (err) {
|
||||
this.logger.error(`[Chat Sync] failed to initialize languages:\n${err.stack}`);
|
||||
throw err; // Re-throw to handle it upstream
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user