danxfisher / MeetEasier

MeetEasier is a web application that visualizes meeting room availability. It works using Exchange Web Services (EWS) with Exchange room lists in Office 365.
GNU General Public License v3.0
279 stars 74 forks source link

UnhandledPromiseRejectionWarning #57

Open TerrorSource opened 5 years ago

TerrorSource commented 5 years ago

I created 3 room mailboxes in an demo azure tenant. MeetingRoom1 MeetingRoom2 MeetingRoom3

Created a test meeting in all 3 room's which was automatically accepted. Created a Distribution List named "Rooms" and added all 3 meetingrooms in it New-DistributionGroup -Name "Rooms" -DisplayName "Rooms" -PrimarySmtpAddress "rooms@xxx.onmicrosoft.com" -RoomList Add-DistributionGroupMember -Identity "Rooms" -Member "Meetingroom1"

Added admin at xxx.onmicrosoft com with password and domain in the auth.js Added "Meetingroom1 @ xxx.onmicrosoft.com" to room-blacklist.js.

Creating some meetings in the meeting rooms and adding 1 meeting room to the blacklist should solve some issues according to other github issues/reply's

pi@raspberrypi:~/MeetEasier $ npm start

> meet-easier@ start /home/pi/MeetEasier
> node server

now we're cooking.
(node:24337) UnhandledPromiseRejectionWarning: TypeError: ews.TimeSpan.FromHours(...).asMilliseconds is not a function
    at /home/pi/MeetEasier/app/ews/rooms.js:118:141
    at Array.forEach (<anonymous>)
    at /home/pi/MeetEasier/app/ews/rooms.js:116:21
    at new Promise (<anonymous>)
    at getAppointmentsForRooms (/home/pi/MeetEasier/app/ews/rooms.js:109:19)
(node:24337) 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: 2)
(node:24337) [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.
(node:24337) UnhandledPromiseRejectionWarning: TypeError: ews.TimeSpan.FromHours(...).asMilliseconds is not a function
    at /home/pi/MeetEasier/app/ews/rooms.js:118:141
    at Array.forEach (<anonymous>)
    at /home/pi/MeetEasier/app/ews/rooms.js:116:21
    at new Promise (<anonymous>)
    at getAppointmentsForRooms (/home/pi/MeetEasier/app/ews/rooms.js:109:19)
(node:24337) 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: 4)

While this is in the console, the webpage does show the "Rooms" under Locations but it keeps spinning.

Collie147 commented 5 years ago

I've got the same issue, change it to the below it and it should work

var view = new ews.CalendarView(ews.DateTime.Now, new ews.DateTime(ews.DateTime.Now.TotalMilliSeconds + 864000000), 6);