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 command line argument + un-catched exception #120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kile
Copy link

@Kile Kile commented Dec 18, 2024

Hi there!
Awesome project!

I have started to have an issue a few weeks ago where Apple Music will stop being responsive to pause and skip buttons. I am not sure if this is because of this library, so I looked into it.

I cannot consistently reproduce this issue, but the one time I could, I found an error in the logs at the same time:
image

Closing connection to Discord RPC
Error: (1000) Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
    at DiscordIPC.#read (https://deno.land/x/[email protected]/src/conn.ts:180:11)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async https://deno.land/x/[email protected]/src/conn.ts:49:11

Looking into the code, it seems this.rpc.close(); is trusted to not error and any error coming from it is not catched. So in this PR I added a try block around it. Even if this is not the root cause of my issue, it is still a good idea to catch any errors from this line of code.

While running this code locally, I also noticed that it complains about

�[0m�[1m�[31merror�[0m: unexpected argument '--allow-import' found

  tip: a similar argument exists: '--allow-hrtime'
  tip: to pass '--allow-import' as a value, use '-- --allow-import'

Usage: deno run [OPTIONS] [SCRIPT_ARG]...

so I followed the suggestion and used --allow-hrtime instead. If this is intended or my system is outdated feel free to let me know and I will revert this change.

@NextFire
Copy link
Owner

Hi! Can you tell me which deno version are you currently running? (deno -V)

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.

2 participants