Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change two instances of throw "string" to throw new Error. #53

Merged
merged 1 commit into from

2 participants

@phyrex1an

Patch to get stack traces for all exceptions that node-xmpp can throw.

Thanks.

@astro astro merged commit 0c2ebe5 into node-xmpp:master
@astro
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2011
  1. @phyrex1an
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/xmpp/jid.js
  2. +1 −1  lib/xmpp/router.js
View
2  lib/xmpp/jid.js
@@ -27,7 +27,7 @@ function JID(a, b, c) {
this.setDomain(b);
this.setResource(c);
} else
- throw 'Argument error';
+ throw new Error('Argument error');
}
JID.prototype.parseJID = function(s) {
View
2  lib/xmpp/router.js
@@ -493,7 +493,7 @@ Router.prototype.send = function(stanza) {
var domain = (new JID.JID(stanza.attrs.from)).domain;
this.getContext(domain).send(stanza);
} else
- throw 'Sending stanza from a domain we do not host';
+ throw new Error('Sending stanza from a domain we do not host');
};
Router.prototype.hasContext = function(domain) {
Something went wrong with that request. Please try again.