Skip to content

Commit

Permalink
v6.3.0 - Update sc-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jondubois committed Jul 24, 2017
1 parent 760c538 commit 816d8ac
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "socketcluster-client",
"main": "socketcluster.js",
"version": "6.2.2",
"version": "6.3.0",
"homepage": "https://github.com/SocketCluster/socketcluster-client",
"description": "SocketCluster JavaScript client",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ module.exports.destroy = function (options) {

module.exports.connections = SCSocketCreator.connections;

module.exports.version = '6.2.2';
module.exports.version = '6.3.0';
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "socketcluster-client",
"description": "SocketCluster JavaScript client",
"version": "6.2.2",
"version": "6.3.0",
"homepage": "http://socketcluster.io",
"contributors": [
{
Expand All @@ -23,7 +23,7 @@
"querystring": "0.2.0",
"sc-channel": "~1.0.6",
"sc-emitter": "~1.1.0",
"sc-errors": "~1.3.2",
"sc-errors": "~1.3.3",
"sc-formatter": "~3.0.0",
"ws": "3.0.0"
},
Expand Down
20 changes: 13 additions & 7 deletions socketcluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ var unserializableErrorProperties = {

module.exports.dehydrateError = function (error, includeStackTrace) {
var dehydratedError;
if (!error || typeof error == 'string') {
dehydratedError = error;
} else {

if (error && typeof error == 'object') {
dehydratedError = {
message: error.message
};
Expand All @@ -376,27 +375,34 @@ module.exports.dehydrateError = function (error, includeStackTrace) {
dehydratedError[i] = error[i];
}
}
} else if (typeof error == 'function') {
dehydratedError = '[function ' + (error.name || 'anonymous') + ']';
} else {
dehydratedError = error;
}

return decycle(dehydratedError);
};

module.exports.hydrateError = function (error) {
var hydratedError = null;
if (error != null) {
if (typeof error == 'string') {
hydratedError = error;
} else {
if (typeof error == 'object') {
hydratedError = new Error(error.message);
for (var i in error) {
if (error.hasOwnProperty(i)) {
hydratedError[i] = error[i];
}
}
} else {
hydratedError = error;
}
}
return hydratedError;
};

module.exports.decycle = decycle;

},{"./decycle":1}],3:[function(require,module,exports){
var SCSocket = require('./lib/scsocket');
var SCSocketCreator = require('./lib/scsocketcreator');
Expand All @@ -416,7 +422,7 @@ module.exports.destroy = function (options) {

module.exports.connections = SCSocketCreator.connections;

module.exports.version = '6.2.2';
module.exports.version = '6.3.0';

},{"./lib/scsocket":6,"./lib/scsocketcreator":7,"sc-emitter":16}],4:[function(require,module,exports){
(function (global){
Expand Down
8 changes: 4 additions & 4 deletions socketcluster.min.js

Large diffs are not rendered by default.

0 comments on commit 816d8ac

Please sign in to comment.