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

Chromecast JS: Improve error logging. #322

Merged

Conversation

Codex-
Copy link
Contributor

@Codex- Codex- commented Mar 20, 2021

I was investigating an issue I was having with casting (which has been fixed somewhere between the Playstore release and the tip of master) and found whenever the Chromecast js logged an error it was not stringified and thus would log [object Object].

EDIT: Actually my issue is still present when using the gradle options to build, will raise an issue.

This PR addresses this by attempting to stringify the instance of chrome.cast.Error, if this fails or throws then the original behaviour will be used.

Before:

2021-03-21 01:25:37.543 7245-7245/org.jellyfin.mobile.debug I/chromium: [INFO:CONSOLE(1444)] "Encountered cast error [object Object]", source: https://www.gstatic.com/cv/js/sender/v1/cast_sender.js (1444)

After:

2021-03-21 00:42:35.321 28384-28384/org.jellyfin.mobile.debug I/chromium: [INFO:CONSOLE(1434)] "Encountered cast error {"code":"unknown","description":"status{statuscode=success, resolution=null} undefined","details":{}}", source: https://www.gstatic.com/cv/js/sender/v1/cast_sender.js (1434)

@nielsvanvelzen
Copy link
Member

I'm quite sure the actual objects shows up when you use the chromium developer tools (in a chromium based browser go to chrome://inspect and the webview should show up with an "inspect" link).

@Maxr1998
Copy link
Member

They should, yes. Not sure what would be preferable here, better support for devtools (for developers) or more transparency when reading logs (for users).

@nielsvanvelzen
Copy link
Member

Most users will post their logs from retrieved from adb in issues so I think it makes sense to improve those messages.

@Codex- Codex- force-pushed the feature/chromecast_improve_error_logging branch from a60aace to 4bdaed5 Compare March 24, 2021 00:55
@Codex- Codex- force-pushed the feature/chromecast_improve_error_logging branch from 4bdaed5 to aff3d70 Compare March 24, 2021 01:07
@Codex-
Copy link
Contributor Author

Codex- commented Mar 24, 2021

Rebased.

@Maxr1998 Maxr1998 merged commit 06999b7 into jellyfin:master Mar 24, 2021
@Codex- Codex- deleted the feature/chromecast_improve_error_logging branch March 24, 2021 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants