getditto / safer_ffi

Write safer FFI code in Rust without polluting it with unsafe code
http://getditto.github.io/safer_ffi
MIT License
925 stars 40 forks source link

Fix JavaScript error messages using `reason` field instead of `message` #160

Closed pvditto closed 1 year ago

pvditto commented 1 year ago

I ran into a wall when the removed new and from_status methods broke derive_ReprC. Can you give me a hint how to continue? @danielhenrymantilla

error[E0599]: no function or associated item named `new` found for struct `safer_ffi::js::Error` in the current scope
   --> src/lib.rs:252:1
    |
252 | #[derive_ReprC(js)]
    | ^^^^^^^^^^^^^^^^^^^ function or associated item not found in `safer_ffi::js::Error`
danielhenrymantilla commented 1 year ago

Yeah, removing Error::new() is ending up to be more disruptive than anticipated; if our code does not rely on the Status in and of itself provided in the new() constructor then we may just ignore it on wasm, and let the safer-ffi-generated code still provide a Status to node.js code, I think