-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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(ShardingManager): client error event cannot be emitted #5559
Conversation
When a Error happens during sending, it can not overwrite err.message. So that a error happens: "TypeError: Cannot set property message of which has only a getter"
I honestly don't agree with this fix. Because you are just creating an object with the key "err" with the value of the error class then adding a "message" key to it. Instead of emitting an error class to the error event (which is what it's supposed to receive), you are now emitting an object. The TypeError happens because the DOMException class has a read-only message property which might need some handling for that. With the # could not be cloned error, I don't think you can send collections/maps to workers. You would need to serialize it to a transferable data structure like an object. |
Should I do Object assign? |
creating a new instance of err to overwrite err.message Co-authored-by: monbrey <[email protected]>
Upgrade from `let` to `const` Co-authored-by: Jan <[email protected]>
Any update on this @meister03? Vlad's request is still pending. |
@kyranet |
Vlad left a requested change above, which is still left without a reply. |
Okay tested it and It seems to work Co-authored-by: Vlad Frangu <[email protected]>
Forgot to test it, and it works, commited the Suggestion |
When a Error happens during sending, it can not overwrite err.message. So that a error happens: "TypeError: Cannot set property message of which has only a getter"
Please describe the changes this PR makes and why it should be merged:
The Error can be reproduced with having the Sharding Manager on Worker Mode and than broadcastEvaling
this.guilds.cache
,the upper scenario works fine for child processes, bc they support many types, but worker threads does not support functions and some other types. So a error comes:
DOMException [DataCloneError]: #<Object> could not be cloned.
This Error can just be logged out when you merge the commit, bc there is a error itself on the _respond function, which should be fixed with the commit. I checked it, multiply times...
Status and versioning classification: