usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [04/51] [abbrv] git commit: Added Usergrid Error class
Date Thu, 13 Feb 2014 14:20:48 GMT
Added Usergrid Error class


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/e0360b98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/e0360b98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/e0360b98

Branch: refs/heads/two-dot-o
Commit: e0360b98d8dc72cb7d0e06b8b8980306d327190f
Parents: bcbbf9a
Author: ryan bridges <rbridges@apigee.com>
Authored: Sat Feb 1 15:17:23 2014 -0500
Committer: ryan bridges <rbridges@apigee.com>
Committed: Sat Feb 1 15:17:23 2014 -0500

----------------------------------------------------------------------
 sdks/html5-javascript/lib/Error.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e0360b98/sdks/html5-javascript/lib/Error.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/Error.js b/sdks/html5-javascript/lib/Error.js
new file mode 100644
index 0000000..05c7393
--- /dev/null
+++ b/sdks/html5-javascript/lib/Error.js
@@ -0,0 +1,16 @@
+
+Usergrid.Error=function(options){
+	this.name="UsergridError";
+	this.timestamp=options.timestamp||Date.now();
+	if(options instanceof Error){
+		this.exception=options.name||"";
+		this.message=options.message||"An error has occurred";
+	}else if("object"===typeof options){
+		this.exception=options.error||"unknown_error";
+		this.message=options.error_description||"An error has occurred";
+	}else if("string"===typeof options){
+		this.exception="unknown_error";
+		this.message=options||"An error has occurred";
+	}
+}
+Usergrid.Error.prototype=new Error();


Mime
View raw message