Improve error handling in short (186 lines) Node.js 6.10 program - 3 functions

Закрито Опубліковано %project.relative_time Оплачується при отриманні
Закрито Оплачується при отриманні

I have a short piece of code that runs in Node.js in a AWS Lambda call.

It makes a https call and stores the results to a data file. Last week the header returned from the https call changed a little and I realized my error handling is less than perfect.

When there are no errors the program works! When there are errors they don't seem to be handled well

You will not be able to run this code against the server! It's too much trouble to make this happen. So I just need you to edit the code, document it, and send it back.

Specific things I know are not great:

1. If the headers returned from the https call are not correct the program keeps going and does not return immediately. ([login to view URL]['content-type'] started comming back as 'application/json;charset=UTF-8'' instead of 'application/json' which it had been.

2. If there is a body['error_description'] the program keeps going.

3. Is it ok / good to redefine body in body = [login to view URL](body);

I am sure there are more.

I don't do a lot of programming in Node.js or javascript so looking for guidance and implementation best practices in this short piece of code.

Also document the code as much as necessary or possible.

Amazon Web Services JavaScript Node.js

ID Проекту: #15955231

Про проект

2 заявок(-ки) Дистанційний проект Остання активність 6 роки(ів) тому

2 фрілансерів(-и) готові виконати цю роботу у середньому за $163

rbluethl

I can offer coding your Lambda function from scratch in TypeScript rather than JavaScript, which makes it more readable, extendable and reliable. Have a look at my review where I did exactly this. Relevant Skills and Більше

$300 USD за 3 дні(-в)
(1 відгук)
2.8