Questions tagged [node.js-domains]

Domains provide a way to handle multiple different IO operations as a single group. If any of the event emitters or callbacks registered to a domain emit an error event, or throw an error, then the domain object will be notified, rather than losing the context of the error in the process.on('uncaughtException') handler, or causing the program to exit with an error code. Also request level domains allow you to maintain the context of a request.

40 questions
0
votes
2 answers

require('use-strict') doesn't work for me

here, I am attempting to set value for read-only property but I am not getting any error: HERE IS MY CODE: require('use-strict'); function Employee(firstname) { var _firstname = firstname; Object.defineProperty(this, 'firstName', { …
0
votes
1 answer

Alternative to Domains for request-level data (user, client, security, etc)

I use NodeJS Domains to store request-level data specific to the current request--the user, the client, and the security authorizations. This data is set when the request starts and is used throughout the many levels of calls to enforce security and…
Samuel Neff
  • 73,278
  • 17
  • 138
  • 182
0
votes
1 answer

Handling form data in nodejs

I am uploading a csv file from my client side javascript as Post request to my node server. I am able to handle the request on the nodejs server as well. Please help me in fetching the file and parsing the file on the server side. The file will be a…
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
0
votes
0 answers

Return error to client with Node.js domains

I read that using domains is proper way of handling unhandled exceptions, but I don't know how to notify the end user for this error. I don't want this error to be unnoticed by the end user, I want to show them an error message. My current code is…
justd
  • 106
  • 1
  • 4
0
votes
1 answer

Getting MS error in installation of jsdom - node js

I am installing jsdom. I am following http://www.steveworkman.com/node-js/2012/installing-jsdom-on-windows/ but I am getting: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform .Targets(23,7): error MSB8007: The Platform…
Ammar Hayder Khan
  • 1,287
  • 4
  • 22
  • 49
0
votes
2 answers

Node.js Server Crash Handling

Is there any way i can do some database updation things whenever my node.js server crashes or stopped. Like try{}catch(){}finally(){} in JAVA. I am a bit newbie here. Is there any events will node emit before it going shutdown. If so i can write my…
Sathish
  • 2,056
  • 3
  • 26
  • 40
0
votes
1 answer

Use node js domains in handler function

I have https server written in express js. And I added domains to my server. App.js file: var d = require('domain').create(); d.on('error', function(error) { console.error("Domain caught error: "+ error.stack); }); d.run(function() { var…
Edgar
  • 113
  • 1
  • 1
  • 7
0
votes
1 answer

Sencha Touch Post to Node.js Error

I am trying get a json with Sencha Touch from a cross-domain node.js my node.js code: app.get('/login', function (req, res) { console.log("Request handler random was called."); res.header("Access-Control-Allow-Origin", "*"); …
Pedro Marques
  • 135
  • 6
  • 14
0
votes
1 answer

node.js defining same array for each room different

As I said at title, I want to define a different array for each room. For example: For room1, array will be var colors=['red','blue'], for room2, array will be var colors=['black','white']. (Same name but different content) Here is my simplified…
-2
votes
1 answer

Node.Js I can't run the server

This is what it supposed to do on Node.Js I am stuck at 6:16 where it said "node server.js" where it supposed to open up 127.0.0.1:3000, but all I get is this error. on my browser it says "ERR_CONNECTION_REFUSED" There is nothing wrong with XAMMP…
1 2
3