@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.es.js CHANGED
@@ -1178,7 +1178,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1178
1178
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1179
1179
  return res.json(fonts2);
1180
1180
  }
1181
- const version = "0.11.5";
1181
+ const version = "0.11.6";
1182
1182
  async function handler(req, res, { apiKey, siteVersions }) {
1183
1183
  if (req.query.secret !== apiKey) {
1184
1184
  return res.status(401).json({ message: "Unauthorized" });
@@ -1280,10 +1280,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1280
1280
  async function translatableData(req, res, client) {
1281
1281
  const elementTree2 = req.body.elementTree;
1282
1282
  if (elementTree2 == null) {
1283
- return res.status(400).json({ message: "elementTree must be defined" });
1283
+ return res.status(400).json({ message: "elementTree must be defined." });
1284
+ }
1285
+ try {
1286
+ let translatableData2 = client.getTranslatableData(elementTree2);
1287
+ return res.json({ translatableData: translatableData2 });
1288
+ } catch (error) {
1289
+ res.status(500).json({ message: "Failed to get traslatable data." });
1284
1290
  }
1285
- const translatableData2 = client.getTranslatableData(elementTree2);
1286
- return res.json({ translatableData: translatableData2 });
1287
1291
  }
1288
1292
  async function mergeTranslatedData(req, res, client) {
1289
1293
  const translatedData = req.body.translatedData;