teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

軽微な修正

2020/05/12 05:19

投稿

AInoue
AInoue

スコア17

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,13 @@
4
4
  以下コードですが、同期的な処理を書いたことがないので、調べながら書いていますが、errorキャッチも、promiseのrejectも試したものの、nodeモジュールの実行結果が最後に来てしまいます。
5
5
 
6
6
  ``` js
7
+ var Redmine = require('node-redemine');
8
+ const hostName = 'host名';
9
+ const config = {
10
+ aiKey: 'apikey';
11
+ }
12
+ var redemine = new Redmine(hostName, config);
13
+ ...
7
14
  function getFromClient(req, res) {
8
15
 
9
16
  var url_parts = url.parse(req.url);
@@ -98,4 +105,6 @@
98
105
  (node:11136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
99
106
  (node:11136) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
100
107
 
101
- ```
108
+ ```
109
+
110
+ 本当であれば、createUser関数を呼び出した時点で、errが発生し、catchするはずなのですが、その結果をcatchできておらず、最後に出力されています。