error handling in Nodejs

简介: If I simply throw the exception:
app.get('/error', (request, response) => {  
  throw new Error('Jerry oops')
});

app.get('/error', (request, response) => {  

 throw new Error('Jerry oops')

});Then:


Error: Jerry oops

at app.get (C:\Code\git\practice\nodejs\index.js:55:9)

at Layer.handle [as handle_request] (C:\Code\git\practice\nodejs\node_modules\express\lib\router\layer.js:95:5)

at next (C:\Code\git\practice\nodejs\node_modules\express\lib\router\route.js:137:13)

at Route.dispatch (C:\Code\git\practice\nodejs\node_modules\express\lib\router\route.js:112:3)

at Layer.handle [as handle_request] (C:\Code\git\practice\nodejs\node_modules\express\lib\router\layer.js:95:5)

at C:\Code\git\practice\nodejs\node_modules\express\lib\router\index.js:281:22

at Function.process_params (C:\Code\git\practice\nodejs\node_modules\express\lib\router\index.js:335:12)

at next (C:\Code\git\practice\nodejs\node_modules\express\lib\router\index.js:275:10)

at app.use (C:\Code\git\practice\nodejs\index.js:45:3)

at Layer.handle [as handle_request] (C:\Code\git\practice\nodejs\node_modules\express\lib\router\layer.js:95:5)


相关文章
|
数据采集 数据库
Kettle之错误处理(Error Handling)里面的坑
Kettle之错误处理(Error Handling)里面的坑
npm 安装出错 npm ERR! request to https://registry.npmjs.org/express failed, reason: unable to verify th
npm 安装出错 npm ERR! request to https://registry.npmjs.org/express failed, reason: unable to verify th
647 0
|
Android开发
XAMRAIN的INSTALL_FAILED_NO_MATCHING_ABIS错误处理
错误提示是:INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-11 解决方法: 打开xamarin .
1490 0
|
3月前
|
机器学习/深度学习 Java Android开发
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
46 0
|
3月前
selenium.common.exceptions.InvalidElementStateException: Message: Unable to perform W3C actions.
selenium.common.exceptions.InvalidElementStateException: Message: Unable to perform W3C actions.
31 0
|
3月前
selenium.common.exceptions.InvalidElementStateException Message Unable to perform W3C actions
selenium.common.exceptions.InvalidElementStateException Message Unable to perform W3C actions
57 0
|
JSON C++ 数据格式
FastAPI(27)- Handling Errors 处理错误 (下)
FastAPI(27)- Handling Errors 处理错误 (下)
460 0
FastAPI(27)- Handling Errors 处理错误 (下)
|
10月前
|
关系型数据库 MySQL C++
fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler
fatal error C1189: #error: STL1003: Unexpected compiler, expected C++ compiler
224 0
|
11月前
|
JavaScript 算法
运行或打包Vue项目:Error: error:0308010C:digital envelope routines::unsupported
运行或打包Vue项目:Error: error:0308010C:digital envelope routines::unsupported
|
Java
Error: A JNI error has occurred, please check your installation and try again
Error: A JNI error has occurred, please check your installation and try again
153 0