@ethisyscore/plugin-ui 1.102.0 → 1.103.0
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.
|
@@ -49,10 +49,16 @@ function stripErrorCodePrefix(body) {
|
|
|
49
49
|
const stripped = body.replace(ErrorCodePrefix, "");
|
|
50
50
|
return stripped.length > 0 ? stripped : body;
|
|
51
51
|
}
|
|
52
|
+
function wasAbandoned(error) {
|
|
53
|
+
return error instanceof Error && (error.name === "AbortError" || error.name === "CancelledError");
|
|
54
|
+
}
|
|
52
55
|
function surfaceError(error, meta) {
|
|
53
56
|
if (meta?.suppressErrorToast === true) {
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
59
|
+
if (wasAbandoned(error)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
56
62
|
const raw = error instanceof Error && error.message.length > 0 ? error.message : "An unexpected error occurred";
|
|
57
63
|
const { status, body } = splitStatusPrefix(raw);
|
|
58
64
|
const reason = stripErrorCodePrefix(body);
|