tiny-invariant icon indicating copy to clipboard operation
tiny-invariant copied to clipboard

idea: extra param for more details

Open Offirmo opened this issue 5 years ago • 0 comments

In dev mode, just an error can be a bit terse. I then have to find the failing assertion and add a bunch of console.log about the current state.

I could include the data in the error message, but:

  • it's not good for privacy
  • it's not good for matching the error in logs

How about an extended API assert(digits.startsWith(ref_digits), 'xxx() ref_digits must match', () => console.error({digits, ref_digits}))

What do you think?

Offirmo avatar Mar 08 '20 21:03 Offirmo