Skip to content

assert: improve ifError

  1. Commit:

It is hard to know where ifError is actually triggered due to the original error being thrown. This changes it by wrapping the original error in a AssertionError. This has the positive effect of also making clear that it is indeed a assertion function that triggered that error.

The original stack can still be accessed by checking the actual property.

  1. Commit:

Show only the Error class and not errors.AssertionError.

  1. Commit:

Make ifError stricter by only accepting null and undefined from now on. Before any truthy value was accepted.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

assert

Merge request reports

Loading