Skip to content

Commit

Permalink
fix: improve exception messages for required actions (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
khskekec committed Sep 27, 2024
1 parent ee2158a commit 4576538
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const LibreLinkUpClient = ({

if (loginResponse.data.status === 4) {
throw new Error(
`Additional action required for your account: ${loginResponse.data.data?.step?.componentName }. Please login via app and perform required steps and try again.`
`Additional action required for your account: ${loginResponse.data.data?.step?.componentName || 'unknown'}. Please login via app and perform required steps and try again.`
);
}

Expand Down Expand Up @@ -166,7 +166,9 @@ export const LibreLinkUpClient = ({
const connections = await getConnections();

if (connections.data.length === 0) {
throw new Error('Your account does not follow any patients. Pleas start following and try again.')
throw new Error(
'Your account does not follow any patients. Pleas start following and try again.'
);
}

connectionId = getConnection(connections.data);
Expand Down

0 comments on commit 4576538

Please sign in to comment.