fg-devkit 1.6.6 → 1.6.7
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/package.json
CHANGED
|
@@ -36,9 +36,16 @@ async function exportLanguage({ token, projectId, language, format }) {
|
|
|
36
36
|
throw new Error(`PoEditor export failed (${res.status})`)
|
|
37
37
|
}
|
|
38
38
|
const data = await res.json()
|
|
39
|
+
if (data?.response?.status !== 'success') {
|
|
40
|
+
const message = data?.response?.message ?? 'Unknown PoEditor error'
|
|
41
|
+
const code = data?.response?.code
|
|
42
|
+
const details = data?.response?.details
|
|
43
|
+
const suffix = [code !== undefined ? `code=${code}` : '', details ? `details=${details}` : ''].filter(Boolean).join(', ')
|
|
44
|
+
throw new Error(`PoEditor export failed for language ${language}: ${message}${suffix ? ` (${suffix})` : ''}`)
|
|
45
|
+
}
|
|
39
46
|
const url = data?.result?.url
|
|
40
47
|
if (!url) {
|
|
41
|
-
throw new Error(`PoEditor export missing URL for language ${language}`)
|
|
48
|
+
throw new Error(`PoEditor export missing URL for language ${language}: ${JSON.stringify(data)}`)
|
|
42
49
|
}
|
|
43
50
|
return url
|
|
44
51
|
}
|