How to use the moleculer.MoleculerRetryableError function in moleculer

To help you get started, we’ve selected a few moleculer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github moleculerjs / moleculer-addons / packages / moleculer-mail / src / index.js View on Github external
this.transporter.sendMail(msg, (err, info) => {
						if (err) {
							this.logger.warn("Unable to send email: ", err);
							reject(new MoleculerRetryableError("Unable to send email! " + err.message));
						} else {
							this.logger.info("Email message sent.", info.response);
							resolve(info);
						}
					});
				}
github icebob / kantab / backend / services / accounts.service.js View on Github external
return jwt.sign(payload, process.env.JWT_SECRET, { expiresIn: expiresIn || this.config["accounts.jwt.expiresIn"] }, (err, token) => {
					if (err) {
						this.logger.warn("JWT token generation error:", err);
						return reject(new MoleculerRetryableError("Unable to generate token", 500, "UNABLE_GENERATE_TOKEN"));
					}

					resolve(token);
				});
			});