It will be nice to have documentation about error handling callback in greenlock #19

Suljettu
opened 2018-09-08 15:46:47 +00:00 by Ghost · 5 kommenttia

I tried to add Sentry support to handle greenlock exceptions and spent substantial amount of time to find solution of this problem.

server.on('tlsClientError', (err) => Raven.captureException(err));

This piece of code can handle greenlock promise rejections

I tried to add Sentry support to handle greenlock exceptions and spent substantial amount of time to find solution of this problem. server.on('tlsClientError', (err) => Raven.captureException(err)); This piece of code can handle greenlock promise rejections
Omistaja

I’m not at all familiar with sentry, but I definitely want you to be able to handle errors.

What is the situation in which an error occurs, what kind of error is it, how does this code help, and what can I do or change to make it easier for you to do what you’re trying to do?

I’m not at all familiar with sentry, but I definitely want you to be able to handle errors. What is the situation in which an error occurs, what kind of error is it, how does this code help, and what can I do or change to make it easier for you to do what you’re trying to do?
Tekijä

Sentry (getsentry.com) allows to track exceptions. Here is an example from my service.

This piece of code:

const server = require('https');
server.createServer(lex.httpsOptions, lex.middleware(app))
server.listen(443, function () {
console.log("Listening for ACME tls-sni-01 challenges and serve app on", this.address());
});
server.on('tlsClientError', (err) => winston.error(err));

allows to add custom error handler for greenlock

Sentry (getsentry.com) allows to track exceptions. Here is an example from my service. This piece of code: const server = require('https'); server.createServer(lex.httpsOptions, lex.middleware(app)) server.listen(443, function () { console.log("Listening for ACME tls-sni-01 challenges and serve app on", this.address()); }); server.on('tlsClientError', (err) => winston.error(err)); allows to add custom error handler for greenlock
Tekijä

Sentry (getsentry.com) allows to track exceptions. Here is an example from my service.

This piece of code:

  const server = require('https');
  server.createServer(lex.httpsOptions, lex.middleware(app))
  server.listen(443, function () {
      console.log("Listening for ACME tls-sni-01 challenges and serve app on", this.address());
  });
  server.on('tlsClientError', (err) => winston.error(err));

allows to add custom error handler for greenlock

Sentry (getsentry.com) allows to track exceptions. Here is an example from my service. This piece of code: ``` const server = require('https'); server.createServer(lex.httpsOptions, lex.middleware(app)) server.listen(443, function () { console.log("Listening for ACME tls-sni-01 challenges and serve app on", this.address()); }); server.on('tlsClientError', (err) => winston.error(err)); ``` allows to add custom error handler for greenlock
Tekijä

Sentry tracks any unhandled exceptions, posts them to your online saas account and emails you notification. It looks to me like a a continuous improvement tool since it notifies you of error conditions that you hadn't considered in your code for further investigation.

It's effectively a giant try catch block around your code which then logs the error and context to a database so you can be informed and query the metadata.

It looks like initially this could be handled with documentation. If someone is using the express version, they can add sentry as a wrapper against the main module - but this looks like a raven/sentry piece of info rather than anything to do with greenlock.

It might be useful to provide docs on how to override the logging and exception handling instead but that's user docs rather than code change or even usage docs.

aj - whats the best way to provide you with documentation enhancements?
gugu - are you able to create a pull request for helpful information?

Sentry tracks any unhandled exceptions, posts them to your online saas account and emails you notification. It looks to me like a a continuous improvement tool since it notifies you of error conditions that you hadn't considered in your code for further investigation. It's effectively a giant try catch block around your code which then logs the error and context to a database so you can be informed and query the metadata. It looks like initially this could be handled with documentation. If someone is using the express version, they can add sentry as a wrapper against the main module - but this looks like a raven/sentry piece of info rather than anything to do with greenlock. It might be useful to provide docs on how to override the logging and exception handling instead but that's user docs rather than code change or even usage docs. aj - whats the best way to provide you with documentation enhancements? gugu - are you able to create a pull request for helpful information?
Omistaja

Greenlock v3 now has a notify facility for handling background errors, as well as general statuses:

coolaj86/greenlock.js#24 (comment)

Greenlock v3 now has a `notify` facility for handling background errors, as well as general statuses: https://git.coolaj86.com/coolaj86/greenlock.js/issues/24#issuecomment-1371
coolaj86 sulki tämän ongelman 2019-11-01 22:00:25 +00:00
Sign in to join this conversation.
Ei tunnistetta
Ei merkkipaalua
Ei käsittelijää
2 osallistujaa
Ilmoitukset
Määräpäivä
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

Määräpäivää ei asetettu.

Riippuvuudet

Riippuvuuksia ei asetettu.

Reference: coolaj86/greenlock.js-ARCHIVED#19
No description provided.