Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump moleculer from 0.14.18 to 0.14.19 in /ee/server/services #179

Merged

Conversation

dependabot[bot]
Copy link

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

Bumps moleculer from 0.14.18 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
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch from 5f9ddfd to 920c570 Compare January 10, 2022 07:41
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch 3 times, most recently from 8202c42 to 5d2e2ac Compare March 11, 2022 21:06
Bumps [moleculer](https://github.com/moleculerjs/moleculer) from 0.14.18 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.18...v0.14.19)

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

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch from 5d2e2ac to 63f2e88 Compare March 11, 2022 21:08
@Tenet1Ai Tenet1Ai merged commit 6c2bd31 into develop Apr 16, 2022
@Tenet1Ai Tenet1Ai deleted the dependabot/npm_and_yarn/ee/server/services/moleculer-0.14.19 branch April 16, 2022 14:21
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.

1 participant