@pitcher/cli-scripts 2.2.1 → 2.2.2
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.
|
@@ -24,9 +24,13 @@ function isVersionAlreadyExistsError(e) {
|
|
|
24
24
|
const err = e;
|
|
25
25
|
if (err?.response?.status !== 400)
|
|
26
26
|
return false;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// Only the version-release conflict — which the API reports in DRF
|
|
28
|
+
// `non_field_errors` — is a benign no-op. Don't scan the whole body: an
|
|
29
|
+
// unrelated 400 that merely mentions "already exists" (e.g. a field-level
|
|
30
|
+
// name/identifier conflict when creating a NEW app) is a real failure.
|
|
31
|
+
const nonField = err.response?.data?.non_field_errors;
|
|
32
|
+
const messages = Array.isArray(nonField) ? nonField : typeof nonField === 'string' ? [nonField] : [];
|
|
33
|
+
return messages.some((m) => typeof m === 'string' && /version .* already exists/i.test(m));
|
|
30
34
|
}
|
|
31
35
|
function buildVersion(now) {
|
|
32
36
|
const year = now.getFullYear();
|