richardperryman / NFC-Engineering-Project

1 stars 0 forks source link

Current node mock server doesn't handle errors well #5

Closed richardperryman closed 7 years ago

richardperryman commented 8 years ago

I believe, through having done some testing, that all execution paths on our server response function must return or throw. Otherwise the server gets in a bad state waiting for that one request forever. In many cases I think just adding throw err; will be sufficient.

Surerocks commented 8 years ago

I agree, it would make sense to do this. For the case of throwing, it is important to still respond to the client, so just return a 500 error, with a message saying "Not yet implemented" or in the case of actual errors, give an appropriate message. I am hoping to have the paths working with a basic response within a couple days, so once that is done we shouldn't have many if any explicit errors of this type