ewebsock icon indicating copy to clipboard operation
ewebsock copied to clipboard

feat: close event error code

Open dzmitry-lahoda opened this issue 8 months ago • 2 comments

  • Closes #59

dzmitry-lahoda avatar Apr 14 '25 00:04 dzmitry-lahoda

@emilk i do not think adding reason string is good now. unfortunately there is some variability in codes and specs and likely impls, making adding it brittle over several platforms.

i think can cleanup comments and code just for code, but for reason imho need to think more (by thinking i mean tokio and web sys teams think about things as experts - web-sys::CloseEvent, tokio::CloseFrame and RFC - all have different inconsistent interfaces - i am afraid cannot rely on same behavior of reason on all stacks)

dzmitry-lahoda avatar Apr 14 '25 15:04 dzmitry-lahoda

reason doesn't need to be consistent, just be human-readable.

Btw, merge in main in order to (hopefully) fix the CI

emilk avatar Apr 15 '25 09:04 emilk

@emilk i can finish PR only with code, no string. if need string - please close PR.

i do no see that string abstraction is consistent in web sys and tungestine. also i biased to custom error codes (so that each category+source of error - own code - so no need strings).

dzmitry-lahoda avatar May 14 '25 19:05 dzmitry-lahoda