node.js - How to return errors from Expresss object on a node listening http -



node.js - How to return errors from Expresss object on a node listening http -

newbie on node have web form calls node http server running java applet. works fine. works great , prints errors console.

i want errors or "success" notice sent user after applet has run. running on listening http server. i've tried many adaptations. here code:

var express = require('express'); var app = express(); ... app.get('/processfile', function(request, response) { java.classpath.push("../lib/commons-io-2.4.jar"); ... seek { var g2rdf = java.callstaticmethodsync("com.pck1.processfile.runner", "nodejs", request.query.user, request.query.pass, request.query.file); } grab (ex) { console.log(ex.cause.getmessagesync(); } <-- response go here ? --> }); <!-- add together callback server? --> var httpsserver = http.createserver(app); httpserver.listen(8080);

the app invoked form jquery process form on index.html page

$.get('/processfile', { user : username, pass : password, file : filename, auth })

why don't render custom error view ?

or homecoming http error :

response.send(500, { error: "something wrong" });

edit : more info send() method @ http://expressjs.com/4x/api.html#res.send

node.js express

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -