[MakeAPI] Add error handling for MongoDB connection

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: mjschranz, Assigned: mjschranz)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
There is no error handling currently. We need to write ways to ensure that it connects and prevent use of the API if it isn't connected.
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

6 years ago
Created attachment 738150 [details] [review]
https://github.com/mozilla/MakeAPI/pull/9

This adds in some error handling for when connection to MongoDB fails. Also adds in some middleware.
Attachment #738150 - Flags: review?(chris)
Comment on attachment 738150 [details] [review]
https://github.com/mozilla/MakeAPI/pull/9

Check how you're handling connection success/errors for the database. It's confusing as-is.
Attachment #738150 - Flags: review?(chris) → review-
(Assignee)

Comment 3

6 years ago
Comment on attachment 738150 [details] [review]
https://github.com/mozilla/MakeAPI/pull/9

That was a silly mistake.
Attachment #738150 - Flags: review- → review?(chris)
Comment on attachment 738150 [details] [review]
https://github.com/mozilla/MakeAPI/pull/9

I don't like that the app doesn't die if the DB connection fails. Can we force it to end the process? No point in keeping it running if we have no data.
Attachment #738150 - Flags: review?(chris) → review-
(Assignee)

Comment 5

6 years ago
This is actually the major point Wex had against landing this sooner. I'm going to ping him and see if we want to go that direction now or later.
(Assignee)

Comment 6

6 years ago
Staged: https://github.com/mozilla/MakeAPI/commit/3ae1302dfd89d604635ba6ee40fe62447ce91bfc
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.