Summarize some error types in Node. js and summarize the node. js types.
Preface
Multiple types of errors may occur in Node. js applications. For example, if a syntax
As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
Detailed description of custom error types in Node. js and node. js
Preface
In general, few people will consider how to deal with the wrong policies generated by the application. In the debugging process, they simply useconsole.log(‘erro
, this is all a small problem.This static class still finds minor problems:Here is a base class. Person.js file name./* defining the person base class */ module.exports=function() { this. name= ' person '; this. sleep=function() { console.log (' person sleep '); } this. eat=function() { console.log (' person eat ');} }Then here is
10.1 Handling Errors using domain module/27210.1.1 Domain Module Overview/27210.1.2 Creating and Using domain objects/27410.1.3 implicit binding vs. explicit binding/27610.1.4 binding callback function with intercept callback function/27910.1.5 the pop-up and push-in of the domain stack/280Destruction of 10.1.6 domain objects/28610.2 Assertion processing in node. js/28610.2.1 equal method and NotEqual metho
Abnormal handling of noisy NodejsMany people have such an image, Nodejs faster, but because it is single-threaded, it is not stable, a little insecure, not suitable for dealing with complex business, it is more suitable for high concurrency requirements, and simple business scenarios.The author of the Express's TJ Holowaychuk's farewell to node. JS article lists the following counts:Farewell NodeJS (TJ Holo
HeaderAdditional Information: Content type, Server send response date, HTTP status codeBody InformationUser-submitted form data, or the returned dataRequest method for HTTPGet: GET, read dataPOST: Submitting data to a specified resourcePUT: UpdateDelete: RemoveHEAD: Similar to get, the server does not return all dataStatus code
1xx
The identity request is accepted
2xx
The request was successfully accepted and disposed of
3xx
redirect
to generate node. js helper class.
The code is simple:
The Code is as follows:
Var http = require ('http ');Var fs = require ('fs ');Var $ = require ('jquery ');Var output = "httpStatusCode/index. js? 6.1.3 ";(Function (){String. format = function (){Var s = arguments [0];For (var I = 0; I Var reg = new RegExp ("\\
As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
{ //Ball on the left if(MarginLeftdistance) {MarginLeft++ }Else{ //the ball is on the rightmarginleft-- } //adjust the position of the ballBall.style.marginLeft=MarginLeft animate (ball, distance, CD)}, -) } //Control AnimationsAnimate (Ball1, -,function() {animate (Ball2, $, function() {animate (Ball3, Max, function() {animate (Ball2, Max, function() {animate (Ball
Background notesRecently there is a scenario in the work item:
A file system server is implemented using the node. JS Express Framework, which has an API for uploading files to clients. The client uses node. JS's httpclient to invoke the server-side API to upload files.
The client does not have any problem when uploading the small file, httpclient r
The AJAX request for the node. JS interface has the following error:XMLHttpRequest cannot load http://xxx.xxx.xx.xx:8888/getTem?cityId=110105date=2015-03-04. No ' Access-control-allow-origin ' header is present on the requested resource. Origin ' null ' is therefore not allowed access.Baidu a bit, the original is missing Access-control-allow-origin attribute, then the n
"Installing node. js Error under Win7: Roling Back Action"Workaround:node. JS server-side JavaScriptnode. JS is a platform built on the chrome JavaScript runtime to easily build fast, easy-to-scale Web applications · node.
Node. js connect ECONNREFUSED error solution, connecteconnrefused
Recently I encountered this error in my mac development when preparing Angularjs + node. js demo, as shown below:
Events. js
In node. js, the various modules have a standard notation: This function (Err, stdout, stderr) { callback (err, stdout, stderr); })The standard here refers to the callback function, which generally has err as the first parameter, then the specific data.When you write a server program, you will more or less use the child_process module, and the usage of this module is as shown in the above
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.