@adminforth/i18n 1.0.18-next.7 → 1.0.18-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -375,8 +375,8 @@ ${JSON.stringify(strings.reduce((acc, s) => {
375
375
  res = resp.content.split("```json")[1].split("```")[0];
376
376
  }
377
377
  catch (e) {
378
- console.error('error in parsing OpenAI', resp);
379
- throw new AiTranslateError('Error in parsing OpenAI response');
378
+ console.error(`Error in parsing OpenAI: ${resp}\n Prompt was: ${prompt}\n Resp was: ${resp}`);
379
+ return [];
380
380
  }
381
381
  res = JSON.parse(res);
382
382
  for (const [enStr, translatedStr] of Object.entries(res)) {
package/index.ts CHANGED
@@ -437,8 +437,8 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
437
437
  try {
438
438
  res = resp.content.split("```json")[1].split("```")[0];
439
439
  } catch (e) {
440
- console.error('error in parsing OpenAI', resp);
441
- throw new AiTranslateError('Error in parsing OpenAI response');
440
+ console.error(`Error in parsing OpenAI: ${resp}\n Prompt was: ${prompt}\n Resp was: ${resp}`, );
441
+ return [];
442
442
  }
443
443
  res = JSON.parse(res);
444
444
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "1.0.18-next.7",
3
+ "version": "1.0.18-next.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",