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

Lezárva Kiadva: 6 évvel ezelőtt Kiszállításkor fizetve
Lezárva Kiszállításkor fizetve

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

Projektazonosító: #15955231

A projektről

2 ajánlat Távolról teljesíthető projekt Utoljára aktív: 6 évvel ezelőtt

2 szabadúszó tett átlagosan 163$ összegű árajánlatot erre a munkára

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 Továbbiak

$300 USD 3 napon belül
(1 Visszajelzés)
2.8