In the process of writing nodeJS project, When I deleted some data in the database, I made the judgment of various conditions first, and then deleted the data after meeting them. The first time it is deleted, it can be successfully deleted, then repeat the action of deleting the last time, the following error will occur:
Events. Js: 160
throw er; // Unhandled ‘error’ event
^
Events. Js: 160
throw er; // Unhandled ‘error’ event
^
error: Write after end
the at ServerResponse. OutgoingMessage. Write (_http_outgoing. Js: 439:15)
the at F: \ \ userHandler SL js: 355:35
the at F: \ \ mon SL js: 84:5
the at handleCallback (F:\SL\node_modules\ lib\utils.js:120:56)
at F:\SL\ node_modules.js :1243:5
at F:\SL\node_modules\mongodb-core\lib\connection\pool.js:461:18
at Combinedtickcallback (internal/process/next_tick.js:67:7)
at process._tickcallback (internal/process/next_tick.js:98:9)
Some said that nodeJS version is too high, and some dropped from 7 to 6. My version is 6.
Solutions:
I add a return after each condition; Statement to solve the above problem.
Read More:
- Events.js:167 throw er appears when starting node service under linux; // Unhandled ‘error’ event solution
- Error code: events.js:183 throw er; // Unhandled’error’ event—solution
- solve events.js:174 Throw er; / / error reported by unhandled ‘error’ event
- Error reported in react events.js:160 throw er; // Unhandled’error’ event
- Unhandled exception at 0x00000000: 0xc0000005: access violation at position 0x0000000000
- node.js Error: write epipe problem solved!
- Asynchronous loading JS does not allow the use of document write solution
- Dxly solves the fatal error of AutoCAD2006: unhandled access violation reading 0x0000 exception at 6532b0h.
- C language error: expected declaration or statement at end of input
- Split keyword in ABAP when the separator is at the beginning and end of the string
- There is an unhandled exception at: 0xc0000005: an access conflict occurred while reading location 0x00000000.
- !!!! You must write Log Message,at least 5 characters. Commit aborted !!!!
- error: expected declaration or statement at end of input
- error Newline required at end of file but not found eol-last
- C language error – [error] expected declaration or statemt at end of input— solution.
- XML file should have root tag (extra content at the end of the document in file error)
- [Solved] VUE3.0 Warning: Added non-passive event listener to a scroll-blocking ‘mousewheel‘ event如何解决
- C language write() function analysis: write failed bad address
- Project files may be invalid appears when cmake compiles opencv3.1, and the debug additional dependency of the compiled opencv3.1 is at the end
- The back end cannot receive the parameters passed by the front end