Giter VIP home page Giter VIP logo

Comments (4)

baudehlo avatar baudehlo commented on May 18, 2024

Interestingly that one comes because of the global process.on('uncaughtException') which I'm thinking of getting rid of anyway...

from haraka.

smfreegard avatar smfreegard commented on May 18, 2024

Ok - but my point was shouldn't it be up to the log plugin to strip LF's or not?

As for getting rid of the uncaughtException process event; for plugins with syntax errors - it's not very useful as vm.runInNewContextContext() exceptions do not show the file and line number of the actual error despite 'name' being provided to it.

I've just modified my plugins.js to this:

try {
    vm.runInNewContext(code, sandbox, name);
}
catch (err) {
    logger.logcrit('Loading plugin ' + name + ' failed: ', err.message);
    if (config.get('smtp.ini', 'nolog', 'ini').main.ignore_bad_plugins) {
        return;
    }
    else {
        throw 'plugin_error';
    }
}

That provides much briefer output on plugin errors and is no less useful than a full stack trace:

[root@vm3 Haraka]# node haraka.js
[DEBUG] no cluster available, running single-process
Starting up Haraka version 0.9.0
[INFO] Loading plugins
[INFO] Loading plugin: stats
[CRIT] Loading plugin stats failed: Unexpected token .
[CRIT] Caught exception: plugin_error
[CRIT] Server not ready yet. Stopping.

from haraka.

justinpincar avatar justinpincar commented on May 18, 2024

+1. No line breaks makes errors extremely difficult to read.

from haraka.

baudehlo avatar baudehlo commented on May 18, 2024

Please try 1.0.0. Closing this issue for now.

from haraka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.