refactor: put conditional into just one line

This commit is contained in:
P. Reis 2024-07-02 18:43:28 -03:00
parent d3c3ecfd35
commit ba29035413

View file

@ -77,9 +77,7 @@ function connectStream(socket: WebSocket) {
send(['EVENT', subId, event]);
}
} catch (e) {
if (
e instanceof RelayError
) {
if (e instanceof RelayError) {
send(['CLOSED', subId, e.message]);
} else {
send(['CLOSED', subId, 'error: something went wrong']);