@stemy/ngx-utils 19.6.5 → 19.6.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.
|
@@ -3084,8 +3084,11 @@ class BaseHttpService {
|
|
|
3084
3084
|
return;
|
|
3085
3085
|
}
|
|
3086
3086
|
const regex = /((E11000 duplicate key error collection: (.)+\.)|(_1 dup key:(.)+))/g;
|
|
3087
|
-
|
|
3088
|
-
|
|
3087
|
+
const message = ObjectUtils.isObject(reason.message)
|
|
3088
|
+
? String(reason.message?.message || "Unknown error")
|
|
3089
|
+
: String(reason.message || "Unknown error");
|
|
3090
|
+
if (message && regex.test(message)) {
|
|
3091
|
+
this.toastError("message.duplicate-key.error." + message.replace(regex, "").replace(" index: ", "-"), issueContext, reason, options);
|
|
3089
3092
|
return;
|
|
3090
3093
|
}
|
|
3091
3094
|
this.toastWarning(`${url} endpoint error is not handled properly! Click here, to quickly create an issue.`, issueContext, reason, options);
|