Beispiel
Handle es-toolkit AbortError name defaulting to 'Error' and code defaulting to 0
sha256:248e285b14a91c88ba52065b200f8a090be882be704fd8d3fd458230a10b18d3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- node
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- node
- Sprache
- node
- Paketmanager
- npm
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- node 22
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- node 22
- Sprache
- javascript
- Paketmanager
- npm
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18
Fall
- Ziel
- Handle es-toolkit AbortError name defaulting to 'Error' and code defaulting to 0 HOW
- Pakete
-
es-toolkit 1.50.0
- Umgebung
- node
- Erstellt
- 2026-08-18T00:45:52Z
Häufige Annahme
Instantiating or catching AbortError yields an error object whose name property is 'AbortError' and code is 20 (DOMException.ABORT_ERR).
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- AbortError instances have name set to 'Error' and code set to 0 rather than 'AbortError' and 20 because its constructor extends DOMException and invokes super(message) without the name argument
- AbortError constructor is exported identically from the package root and es-toolkit/error subpath
- delay rejects on aborted signal with an AbortError whose name is 'Error' and code is 0, discarding any custom signal reason
- catching AbortError requires instanceof or constructor.name checks rather than error.name equality
- isError returns true for AbortError while compat isError returns false due to the [object DOMException] tag
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18 · ed25519:d91480838ac982c9