@feathersjs/transport-commons
Advanced tools
Comparing version 4.0.1 to 4.0.2
# Change Log | ||
## [v4.0.1](https://github.com/feathersjs/transport-commons/tree/v4.0.1) (2018-05-30) | ||
[Full Changelog](https://github.com/feathersjs/transport-commons/compare/v4.0.0...v4.0.1) | ||
**Merged pull requests:** | ||
- Update Codeclimate settings [\#74](https://github.com/feathersjs/transport-commons/pull/74) ([daffl](https://github.com/daffl)) | ||
## [v4.0.0](https://github.com/feathersjs/transport-commons/tree/v4.0.0) (2018-02-09) | ||
@@ -4,0 +11,0 @@ [Full Changelog](https://github.com/feathersjs/transport-commons/compare/v3.2.0...v4.0.0) |
@@ -16,3 +16,7 @@ const Router = require('radix-router'); | ||
lookup (path) { | ||
return this[ROUTER].lookup(stripSlashes(path)); | ||
if (!path) { | ||
return null; | ||
} | ||
return this[ROUTER].lookup(stripSlashes('' + path)); | ||
} | ||
@@ -19,0 +23,0 @@ }); |
@@ -68,2 +68,6 @@ const errors = require('@feathersjs/errors'); | ||
const handleError = error => { | ||
debug(`Error in ${trace}`, error); | ||
callback(normalizeError(error)); | ||
}; | ||
// A wrapper function that runs the method and returns a promise | ||
@@ -97,14 +101,13 @@ const _run = () => { | ||
// Run and map to the callback that is being called for Socket calls | ||
_run().then(hook => { | ||
const result = hook.dispatch || hook.result; | ||
try { | ||
// Run and map to the callback that is being called for Socket calls | ||
_run().then(hook => { | ||
const result = hook.dispatch || hook.result; | ||
debug(`Returned successfully ${trace}`, result); | ||
callback(null, result); | ||
}).catch(hook => { | ||
const error = hook.type === 'error' ? hook.error : hook; | ||
debug(`Error in ${trace}`, error); | ||
callback(normalizeError(error)); | ||
}); | ||
debug(`Returned successfully ${trace}`, result); | ||
callback(null, result); | ||
}).catch(hook => handleError(hook.type === 'error' ? hook.error : hook)); | ||
} catch (error) { | ||
handleError(error); | ||
} | ||
}; |
{ | ||
"name": "@feathersjs/transport-commons", | ||
"description": "Shared functionality for websocket providers", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"homepage": "https://github.com/feathersjs/transport-commons", | ||
@@ -6,0 +6,0 @@ "main": "lib/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39028
449