Skip to content

Commit

Permalink
Don't include full payload when throwing error on missing event or ca…
Browse files Browse the repository at this point in the history
…tegory in trackEvent
  • Loading branch information
danjm committed May 24, 2021
1 parent 3c91e04 commit d6f355f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/scripts/controllers/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,15 @@ export default class MetaMetricsController {
// event and category are required fields for all payloads
if (!payload.event || !payload.category) {
throw new Error(
`Must specify event and category. Passed payload was: ${JSON.stringify(
`Must specify event and category. Event was: ${
payload.event
}. Category was: ${payload.category}. Payload keys were: ${Object.keys(
payload,
)}`,
)}. ${
typeof payload.properties === 'object'
? `Payload property keys were: ${Object.keys(payload.properties)}`
: ''
}`,
);
}

Expand Down

0 comments on commit d6f355f

Please sign in to comment.