@makeswift/runtime 0.11.5 → 0.11.6

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.cjs.js CHANGED
@@ -1211,7 +1211,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1211
1211
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1212
1212
  return res.json(fonts2);
1213
1213
  }
1214
- const version = "0.11.5";
1214
+ const version = "0.11.6";
1215
1215
  async function handler(req, res, { apiKey, siteVersions }) {
1216
1216
  if (req.query.secret !== apiKey) {
1217
1217
  return res.status(401).json({ message: "Unauthorized" });
@@ -1313,10 +1313,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1313
1313
  async function translatableData(req, res, client) {
1314
1314
  const elementTree2 = req.body.elementTree;
1315
1315
  if (elementTree2 == null) {
1316
- return res.status(400).json({ message: "elementTree must be defined" });
1316
+ return res.status(400).json({ message: "elementTree must be defined." });
1317
+ }
1318
+ try {
1319
+ let translatableData2 = client.getTranslatableData(elementTree2);
1320
+ return res.json({ translatableData: translatableData2 });
1321
+ } catch (error) {
1322
+ res.status(500).json({ message: "Failed to get traslatable data." });
1317
1323
  }
1318
- const translatableData2 = client.getTranslatableData(elementTree2);
1319
- return res.json({ translatableData: translatableData2 });
1320
1324
  }
1321
1325
  async function mergeTranslatedData(req, res, client) {
1322
1326
  const translatedData = req.body.translatedData;