You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sending a string literal to panic does not print the payload in the console. E.g panic!("My error");
Whereas it does print the message if a String is used. E.g panic!(String::from("My error"));
I'm currently hitting some issues getting started with a cargo-web project. I'm new to a lot of the area so I'm making a lot of mistakes. Unfortunatly, I often don't see the error messages that go along with the errors.
I've noticed initialize helpfully adds a panic hook to expose those errors including: A static message, and (when it has it) a location and an error payload. But I don't appear to see the error payload.
@jahredhope your analysis is correct.
I managed to create a version which supports both String and &str locally by patching the file you linked,
I'll try to issue a PR in the next few days.
Sending a string literal to panic does not print the payload in the console. E.g
panic!("My error");
Whereas it does print the message if a String is used. E.g
panic!(String::from("My error"));
I'm currently hitting some issues getting started with a
cargo-web
project. I'm new to a lot of the area so I'm making a lot of mistakes. Unfortunatly, I often don't see the error messages that go along with the errors.I've noticed
initialize
helpfully adds a panic hook to expose those errors including: A static message, and (when it has it) a location and an error payload. But I don't appear to see the error payload.I believe one reason is it appears to try to cast the payload to a String, but PanicInfo seems to indicate it's commonly a
String
or a&str
.https://github.com/koute/stdweb/blob/master/src/webcore/initialization.rs#L28
So code like this would see the message in Console:
But code like this wont:
The text was updated successfully, but these errors were encountered: