Skip to content

Comments

Bump moleculer from 0.14.14 to 0.14.19 in /ee/server/services#44

Closed
dependabot[bot] wants to merge 1 commit into3.18.5-pdisfrom
dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19
Closed

Bump moleculer from 0.14.14 to 0.14.19 in /ee/server/services#44
dependabot[bot] wants to merge 1 commit into3.18.5-pdisfrom
dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Jan 10, 2022

Bumps moleculer from 0.14.14 to 0.14.19.

Release notes

Sourced from moleculer's releases.

v0.14.19

69 commits from 7 contributors.

Custom error recreation feature #1017

You can create a custom Regenerator class which is able to serialize and deserialize your custom errors. It's necessary when the custom error is created on a remote node and must be serialized to be able to sent back to the caller.

Create a custom Regenerator

const { Regenerator, MoleculerError } = require("moleculer").Errors;
class TimestampedError extends MoleculerError {
constructor(message, code, type, data, timestamp) {
super(message, code, type, data);
this.timestamp = timestamp;
}
}
class CustomRegenerator extends Regenerator {
restoreCustomError(plainError, payload) {
const { name, message, code, type, data, timestamp } = plainError;
switch (name) {
case "TimestampedError":
return new TimestampedError(message, code, type, data, timestamp);
}
}
extractPlainError(err) {
return {
...super.extractPlainError(err),
timestamp: err.timestamp
};
}
}
module.exports = CustomRegenerator;

Use it in broker options

// moleculer.config.js
const CustomRegenerator = require("./custom-regenerator");
module.exports = {
    errorRegenerator: new CustomRegenerator()
}

Error events #1048

When an error occured inside ServiceBroker, it's printed to the console, but there was no option that you can process it programatically (e.g. transfer to an external monitoring service). This feature solves it. Every error inside ServiceBroker broadcasts a local (not transported) event ($transporter.error, $broker.error, $transit.error, $cacher.error, $discoverer.error) what you can listen in your dedicated service or in a middleware.

Example to listen in an error-tracker service

module.exports = {
</tr></table> 

... (truncated)

Changelog

Sourced from moleculer's changelog.

0.14.19 (2022-01-08)

69 commits from 7 contributors.

Custom error recreation feature #1017

You can create a custom Regenerator class which is able to serialize and deserialize your custom errors. It's necessary when the custom error is created on a remote node and must be serialized to be able to sent back to the caller.

Create a custom Regenerator

const { Regenerator, MoleculerError } = require("moleculer").Errors;
class TimestampedError extends MoleculerError {
constructor(message, code, type, data, timestamp) {
super(message, code, type, data);
this.timestamp = timestamp;
}
}
class CustomRegenerator extends Regenerator {
restoreCustomError(plainError, payload) {
const { name, message, code, type, data, timestamp } = plainError;
switch (name) {
case "TimestampedError":
return new TimestampedError(message, code, type, data, timestamp);
}
}
extractPlainError(err) {
return {
...super.extractPlainError(err),
timestamp: err.timestamp
};
}
}
module.exports = CustomRegenerator;

Use it in broker options

// moleculer.config.js
const CustomRegenerator = require("./custom-regenerator");
module.exports = {
    errorRegenerator: new CustomRegenerator()
}

Error events #1048

When an error occured inside ServiceBroker, it's printed to the console, but there was no option that you can process it programatically (e.g. transfer to an external monitoring service). This feature solves it. Every error inside ServiceBroker broadcasts a local (not transported) event ($transporter.error, $broker.error, $transit.error, $cacher.error, $discoverer.error) what you can listen in your dedicated service or in a middleware.

Example to listen in an error-tracker service

</tr></table> 

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jan 10, 2022
Bumps [moleculer](https://github.com/moleculerjs/moleculer) from 0.14.14 to 0.14.19.
- [Release notes](https://github.com/moleculerjs/moleculer/releases)
- [Changelog](https://github.com/moleculerjs/moleculer/blob/master/CHANGELOG.md)
- [Commits](moleculerjs/moleculer@v0.14.14...v0.14.19)

---
updated-dependencies:
- dependency-name: moleculer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot changed the base branch from 3.18.3-pdis to 3.18.5-pdis February 21, 2022 09:00
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch from 0f4f051 to f86241b Compare February 21, 2022 09:00
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Apr 21, 2022

Superseded by #95.

@dependabot dependabot bot closed this Apr 21, 2022
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch April 21, 2022 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants