0xMiden / 0xMiden/web-sdk

follow-up: investigate alternate forms of error handling for web context

Offen
#79 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
1
Forks
21
Ø Merge
12 Std. 14 Min.
Gemergte PRs (30 T.)
41

Beschreibung

After 0xMiden/miden-client#813 the `set_once()` call was removed as it no longer worked. The problem it fixed was that rust panics hanged the web client tests instead of instantly failing.

We should look into new ways of dealing with rust panics in wasm context. @igamigo proposed [`unwrap_throw`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/trait.UnwrapThrowExt.html) which might fix the issue by converting the panic into a js error which can be then handled.

Also, we can investigate if there are better ways of printing the js errors once they get catched in Rust (look in https://github.com/0xPolygonMiden/miden-client/pull/813#discussion_r2017639259 for context).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Untersuche das wasm-bindgen UnwrapThrowExt-Trait, um Rust-Panics in JS-Fehler umzuwandeln. Sieh dir die verlinkte PR #813-Diskussion für den Kontext zur Fehlerausgabe an. Beginne damit, den Setup der Web-Client-Tests und das aktuelle Verhalten von Panics zu verstehen. Ermittle, wie unwrap_throw integriert und die Fehlerbehandlung im Web-Kontext verbessert werden kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust, typescript, wasm
Bereich
devtools, web-dev
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.