diff --git a/.gitignore b/.gitignore index c361cc1..72bbc23 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules # build trash server/dist +server/node-sdk # testing coverage @@ -29,4 +30,9 @@ production.env sandbox.env config.ts -.bluebutton-config.json \ No newline at end of file +.bluebutton-config.json +package-lock.json +yarn.lock + +# Snyk Security Extension - AI Rules (auto-generated) +.github/instructions/snyk_rules.instructions.md \ No newline at end of file diff --git a/server/index.ts b/server/index.ts index fe2d85b..783fbd7 100644 --- a/server/index.ts +++ b/server/index.ts @@ -81,14 +81,18 @@ app.get("/api/bluebutton/callback", (req: Request, res: Response) => { // access token can expire, SDK automatically refresh access token when that happens. const eobResults = await bb.getExplanationOfBenefitData(authToken); authToken = eobResults.token; // in case authToken got refreshed during fhir call - + loggedInUser.authToken = authToken; loggedInUser.eobData = eobResults.response?.data; - } catch (e) { + } catch (e: any) { loggedInUser.eobData = {}; process.stdout.write(ERR_QUERY_EOB + '\n'); process.stderr.write("Exception: " + String(e) + '\n'); + if (e.response) { + console.log("Error status:", e.response.status); + console.log("Error data:", e.response.data); + } } } else { clearBB2Data();