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

Error on trigger webHookshortname1with status code null and body null #17

Open
RobertRajcool opened this issue Nov 21, 2017 · 2 comments

Comments

@RobertRajcool
Copy link

RobertRajcool commented Nov 21, 2017

    // Initialize WebHooks module.
    var WebHooks = require('node-webhooks')
    // Initialize webhooks module from on-disk database
    var webHooks = new WebHooks({
        db: './webHooksDB.json', // json file that store webhook URLs
        httpSuccessCodes: [200, 201, 202, 203, 204], //optional success http status codes
    })
    webHooks.add('test', 'http://127.0.0.1:9000/test').then(function(){
        // done
    }).catch(function(err){
        console.log(err)
    })

    var emitter = webHooks.getEmitter()
    
    emitter.on('*.success', function (shortname, statusCode, body) {
        console.log('Success on trigger webHook' + shortname + 'with status code', statusCode, 'and body', body)
    })
    
    emitter.on('*.failure', function (shortname, statusCode, body) {
        console.log(shortname)
        console.error('Error on trigger webHook' + shortname + 'with status code', statusCode, 'and body', body)
    })`

While trigger the webhook "let wb = webHooks.trigger('test', {data: 123456}, {header: 'header'})" got this error Error on trigger webHookshortname1with status code null and body null

@roccomuso
Copy link
Owner

Sorry for the late response.
What http://127.0.0.1:9000/test returns? Is there a server running?

@yatishbalaji
Copy link

Hey
Any update on this error. I too am facing the same error. Not able to traceback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants