वर्जन 7 से Node.js में वादे को संभालने के लिए async / प्रतीक्षारत शर्करा है और अब मेरे कोड में निम्नलिखित चेतावनी काफी महत्वपूर्ण है:
(node:11057) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): ReferenceError: Error: Can't set headers
after they are sent.
(node:11057) 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.
दुर्भाग्य से उस लाइन का कोई संदर्भ नहीं है जहां कैच छूटा हो। क्या हर कोशिश / कैच ब्लॉक को चेक किए बिना इसे खोजने का कोई तरीका है?
Can't set headers after they are sent.
आपको एक सुराग देना चाहिए कि आपके कोड में यह कहां हो रहा है (यानी कहीं आप हेडर के बाद हेडर सेट कर रहे हैं जो पहले ही भेज दिया गया होगा - संभवतः अतुल्यकालिक कोड को समझने में विफल होने के कारण , लेकिन यह एक अनुमान है)