socket.emitWithAck doesn't throw when an error was passed as the first argument #5275
Labels
package:socket.io-client
This concerns the "socket.io-client" package
question
Further information is requested
Describe the bug
To Reproduce
Socket.IO server version:
4.8.1
Server
Socket.IO client version:
4.8.1
Client
Expected behavior
calling callback on the server-side with a first argument (error) should make the client-side
emitWithAck
throwby removing the
fn.withError = true
from theemitWithAck
function, the functions throws with the error object correctly,onack()
function seems to be insertingnull
as the first argument to packet data ifwithError
is set totrue
, moving the error to the second position, resulting in the promise resolving, not rejecting.i'm able to fix it with
The text was updated successfully, but these errors were encountered: