Skip to content

Conversation

ArtyomPSofteq
Copy link
Contributor

#RI-2356 - specify a human-readable error message

newSocket.on(SocketEvent.ConnectionError, (error: Error) => {
payloads.push({ isError: true, time: `${Date.now()}`, message: `${error?.name}: ${error?.message}` })
newSocket.on(SocketEvent.ConnectionError, (error: { type: string; name: any; message: any }) => {
if (error?.type === 'TransportError') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a enum for constant string? May be in the future any type will added

Copy link
Contributor

@rsergeenko rsergeenko Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and better to use switch case instead of else if in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a enum for constant string? May be in the future any type will added

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and better to use switch case instead of else if in the future

according to the eslint rules, we must have at least one else if, otherwise the swith construct is useless (as in current case)

@ArtyomPSofteq ArtyomPSofteq merged commit 8367991 into feature/RI-1227_monitor Jan 28, 2022
@ArtyomPSofteq ArtyomPSofteq deleted the fix/RI-1227_failed-connection-message branch January 28, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants