Changelog History
Page 7
-
v1.2.7 Changes
Summary
- ๐ Convert server / client handler to instance members (performance)
-
v1.2.6 Changes
Summary
- ๐ Move circuit breaker middleware only on client side circuit breaker
- โ Add tests for callback and promise error handling
- โ Add test for timeouts
- ๐ง Circuit breaker is disabled by default and is configurable
-
v1.2.5 Changes
Summary
- ๐ Implement circuit breaker
- โ Add tests for callback and promise error handling
-
v1.2.4 Changes
Summary
- ๐ Fixed util.pattern, don't concatenate objects to
[object Object]
- โ Add tests
- ๐ Rename some files to *.spec.js
- โ Remove referrers meta$ property after recursion error to reduce payload size
- ๐ Fixed util.pattern, don't concatenate objects to
-
v1.2.3 Changes
Summary
โ Manage plugin dependencies. The
dependencies
attribute is used to identify the dependencies of a plugin. When the plugin could not be resolved a warning appears and an error is thrown. Does not provide version dependency which should be implemented using npm peer dependencies.exports.plugin = function myPlugin (options) { var hemera = this hemera.add({ topic: 'math', cmd: 'add' }, (req, cb) => { cb(null, req.a + req.b) }) } exports.options = {} exports.attributes = { dependencies: ['hemera-joi'], pkg: require('./package.json') }
Error Message
Plugin `myPlugin` requires `hemera-foo` as dependency. Please install with 'npm install --save hemera-foo'
-
v1.2.2 Changes
Summary
Throw only on NATS connection issues. Complete NATS connection error codes. Ensure that we cover all possible cases.
-
v1.2.1 Changes
Summary
Throw only on NATS connection issues. Authorization and Protocol issues are logged but don't lead to a process termination.
-
v1.2.0 Changes
Summary
๐ hemera 1.2.0 is focused on error handling, plugin dependencies
- โฌ๏ธ Upgrade time: low - none to a couple of hours for most users
- Complexity: low - requires following the list of changes to verifying their impact
- Risk: medium - type checks on error will fail because the hemera error was stripped
- Dependencies: low - existing plugins will work as-is
๐ฅ Breaking Changes
๐ You get the exact error you have sent. Errors are wrapped only for framework errors (Parsing errors, Plugin registration errors, Timeout errors) or logging.
๐ New Features
- ๐ง Enable Server policy to abort requests when the server is not able to respond cause (max memory, busy event-loop). Example Configurable
- ๐ง Long stack traces by default. Configurable
- ๐ง Detect message loops (abort the request and return an error). Example Configurable
- ๐ Enrich errors logs with details (pattern, app-name, timestamp).
- Track network hops in error to identify which clients was involved. Example
Migration Checklist
๐ 1. Pull the wrapped error one level up. For any case except for: HemeraParseError, HemeraError "Error during plugin registration, TimeoutError"
Old:
hemera.add({ topic: 'email', cmd: 'send' }, (resp, cb) => { cb(new Error('Uups')) }) hemera.act({ topic: 'email', cmd: 'send', email: '[email protected]', msg: 'Hi!' }, (err, resp) => { expect(err).to.be.exists() expect(err.name).to.be.equals('BusinessError') expect(err.message).to.be.equals('Business Error') expect(err.cause.name).to.be.equals('Error') expect(err.cause.message).to.be.equals('Uups') hemera.close() done() })
๐ New:
hemera.add({ topic: 'email', cmd: 'send' }, (resp, cb) => { cb(new Error('Uups')) }) hemera.act({ topic: 'email', cmd: 'send', email: '[email protected]', msg: 'Hi!' }, (err, resp) => { expect(err).to.be.exists() expect(err.name).to.be.equals('Error') expect(err.message).to.be.equals('Uups') hemera.close() done() })
๐ 2. All logs are wrapped with the correct Hemera error subclass BusinessError, FatalError ...
๐ 3. Plugin dependencies are declared with peerDependencies instead with
dependencies
property in the plugin.Old:
exports.attributes = { dependencies: ['hemera-joi'] pkg: require('./package.json') }
๐ New:
"peerDependencies": { "hemera-joi": "^1.0.4", "nats-hemera": "1.x || 2.x" }