Gm,
I would like to suggest to include an attribute in errors thrown in relay, the relay address info.
export class NetworkError extends Error {
constructor(
msg: string,
public relay: WebSocket['url']
) {
super(msg);
}
}
So you can throw like this:
if (!ok) {
throw new NetworkError(reason, this.url);
}
You think is make sense?