Hi, I am developing a DDP client library for Unity3D, and I think that some parts of the DDP documentation are no longer accurate and need to be fixed.
This is the message I get from Meteor v1.3.2.4
when I try to subscribe to something that doesn't exist on the server:
{"msg":"nosub","id":"0","error":{"error":404,"reason":"Subscription 'friends' not found","message":"Subscription 'friends' not found [404]","errorType":"Meteor.Error"}}
message
should not appear.errorType
field in the documentation but I receive it from the server.Thanks for reporting this. I know this issue hasn't got much attention, but I think a well-written pull request for this would be accepted!
Hi guys - if there are errors, results
and nosub
messages have their error
set by creating a new Meteor.Error
object. For example, nosub
creates a new Meteor.Error
like:
self.send({
msg: 'nosub', id: msg.id,
error: new Meteor.Error(404, `Subscription '${msg.name}' not found`)});
Since both results
and nosub
message errors aren't passing in details
(3rd param to Meteor.Error
), they will always (and only) have:
error
reason
message
errorType
I'll submit a PR to adjust the docs. Thanks!
This should be accurate now thanks to #8173. Thanks, @hwillson and @green-coder!
Most helpful comment
This should be accurate now thanks to #8173. Thanks, @hwillson and @green-coder!