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]); send(['EVENT', subId, event]);
} }
} catch (e) { } catch (e) {
if ( if (e instanceof RelayError) {
e instanceof RelayError
) {
send(['CLOSED', subId, e.message]); send(['CLOSED', subId, e.message]);
} else { } else {
send(['CLOSED', subId, 'error: something went wrong']); send(['CLOSED', subId, 'error: something went wrong']);