ui: support readable errors for kai

This commit is contained in:
nick-delirium 2025-05-21 11:35:16 +02:00
parent 329940433c
commit 20bb27c67c
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -1,4 +1,5 @@
import io from 'socket.io-client';
import { toast } from 'react-toastify';
export class ChatManager {
socket: ReturnType<typeof io>;
@ -41,6 +42,9 @@ export class ChatManager {
console.log('Disconnected from server');
});
socket.on('error', (err) => {
if (err.message) {
toast.error(err.message);
}
console.error('Socket error:', err);
});