Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when error_event does not have "message" or "error" fields #37

Merged
merged 4 commits into from
May 24, 2024

Conversation

romamik
Copy link
Contributor

@romamik romamik commented May 24, 2024

Should fix #25

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

Comment on lines 153 to 154
let message = js_sys::Reflect::get(&error_event, &"message".into()).unwrap();
let error = js_sys::Reflect::get(&error_event, &"error".into()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably replace these unwraps with a fallback, e.g. using unwrap_or_default, otherwise we just get another crash at another time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I just changed to unwrap_or_default.
I do not think it could actually crash, but it looked ugly.

@emilk
Copy link
Member

emilk commented May 24, 2024

There's a clippy warning

@emilk emilk added the include in changelog Include this in CHANGELOG.md label May 24, 2024
@emilk emilk merged commit a865751 into rerun-io:main May 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog Include this in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird expected a string argument error
2 participants