@luolapeikko/ts-common
    Preparing search index...

    Function assertError

    • Asserts that the given value is an Error.

      Parameters

      • err: unknown

        Error to assert.

      Returns asserts err is Error

      If the given value is not an instance of the Error class.

      v0.1.0

      try {
      // ...
      } catch (err) {
      assertError(err);
      console.log(err.message);
      }