How to decode the event from websocket.onError.listen(event)?

22 views
Skip to first unread message

Tom Cervenka

unread,
Feb 19, 2021, 9:42:37 PM2/19/21
to Flutter Development (flutter-dev)
Here is my listener:

webSocket.onError.listen((event) {
print('onError: event=$event');
inspect(event);
});

Here's what shows up in the console:

event=[object Event]

I can't find any useful information about the Event class that would allow me to find out things like the error message or status code. I tried to use "inspect(event)" but that did nothing.

Suzuki Tomohiro

unread,
Feb 19, 2021, 10:07:25 PM2/19/21
to Tom Cervenka, Flutter Development (flutter-dev)
Use breakpoints and debugger to understand the value of the event variable.

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/d15ec2eb-acc4-4616-8a02-29c5c594c6d8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages