-
Notifications
You must be signed in to change notification settings - Fork 59
Error frame confusion #24
Comments
I do agree. I forked previous stomp lib with all pending PR + re-write it in es6 with no major evolution to not break the API a lot. Now I would like to launch a future major release with a lot of enhancement + some test sbut I really need some free time to do it or some PRs to help me. |
Actually, I think it is expected behavior. Because STOMP doesn't declare how to handle ERROR frames, and that's why src/client.js:136 allow a user to decide how to handle it properly. I agree that errorCallback is a bit confusing name, but I can't imagine better. Also, remember that adding special heads require additional server-side enhancement(which most of the time is too hard). |
What's confusing is not the name of the callback, but where it is passed in. It is passed in to the If there is no way for the client to distinguish between a connect and a subscribe error (which seems to be the case), then the error callback should be configured at the client level i.e. before calling connect. |
@rocketraman There is no way to distinguish ERROR frames. I think it's good idea to have 1 global errorHandler per Client instance. |
It looks like when an error frame is received, it is always handled by the
connect
error callback.For example:
CONNECT
-- server returns successSUBSCRIBE
-- server returns error response e.g. permission deniedCONNECT
error callbackThis is pretty confusing and hard to program against -- one would expect some sort of error callback related to the
SUBSCRIBE
for step 2 and 3.The text was updated successfully, but these errors were encountered: