Skip to content

Commit

Permalink
defensive
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGOrtega committed Jul 12, 2022
1 parent 052f68d commit cef1830
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,27 @@ const jitsuEventPayload = async ({
extra = {},
cml
} = {}) => {
const { cloud: backend = '', ...extraRest } = extra;
extraRest.ci = guessCI();

return {
user_id: await userId({ cml }),
group_id: await groupId(),
action,
interface: 'cli',
tool_name: 'cml',
tool_version: VERSION,
tool_source: '',
os_name: OS(),
os_version: os.release(),
backend,
error,
extra: extraRest
};
try {
const { cloud: backend = '', ...extraRest } = extra;
extraRest.ci = guessCI();

return {
user_id: await userId({ cml }),
group_id: await groupId(),
action,
interface: 'cli',
tool_name: 'cml',
tool_version: VERSION,
tool_source: '',
os_name: OS(),
os_version: os.release(),
backend,
error,
extra: extraRest
};
} catch (err) {
return {};
}
};

const send = async ({
Expand Down

2 comments on commit cef1830

@0x2b3bfa0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤺

@github-actions

This comment was marked as off-topic.

Please sign in to comment.