-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
This is more of a question then a issue.
I'm using the @microsoft/signalr (v.6.0.0) javascript client in my Vue project.
This is my Connection Builder
client = new HubConnectionBuilder() .withUrl('/chat', { accessTokenFactory: () => IdService.getToken() }) .configureLogging(LogLevel.None) .withAutomaticReconnect() .build()
Later when I start the connection:
client.start().then(() => { console.log('Connected') }).catch((err) => { console.error(err) })
What I would like to do is, if there is a error in the moment of starting the connection, I would like to know the HTTP status code from the catched error. Like this:
client.start().then(() => { console.log('Connected') }).catch((err) => { console.error(err.response.status) })
The problem is, the error that is getting catched is only a string. Of course I could filter the status code from the string but that seems wrong.
So my question is, is there any way or method to get the error codes?