From 4fe0a0f8586a60eb1fd9e08a9d5ffbb7dfcc9ba3 Mon Sep 17 00:00:00 2001 From: Tyson Clugg Date: Mon, 18 May 2015 12:37:09 +1000 Subject: [PATCH] Send `nosub` in response to bad `sub` request. --- dddp/api.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dddp/api.py b/dddp/api.py index 24c1cd8..dbf4d4d 100644 --- a/dddp/api.py +++ b/dddp/api.py @@ -480,7 +480,15 @@ class DDP(APIMixin): try: pub = self._registry[pub_path(name)] except KeyError: - this.error('Invalid publication name: %r' % name) + this.send_msg({ + 'msg': 'nosub', + 'error': { + 'error': 404, + 'errorType': 'Meteor.Error', + 'message': 'Subscription not found [404]', + 'reason': 'Subscription not found', + }, + }) return obj, created = Subscription.objects.get_or_create( connection_id=this.ws.connection.pk,