try { // block code of try console.log("[+] Return: ", result); return result; } catch (err) { console.log({ type: "Error Logger", data: { Path: req.path, Method: req.method, ErrorStack: err, ErrorMessage: err.message, ErorStatus: err.status, RequestBody: req.body || request.body || body }); // return or other code block } finaly { // block code of finally }