title: How can I safely access caught Error properties in TypeScript?
body: <h2>The Situation</h2>
  <p>I am using TypeScript, and have a try / catch block.  The caught error is typed (<code>Error</code>).  I would like to use the error's <code>message</code> attribute.</p>
  <p>I am using eslint with the <a href="https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md" rel="noreferrer"><code>@typescript-eslint/no-unsafe-assignment</code></a> rule enabled.</p>
  <h2>The Code</h2>
  <pre><code>try {
    throw new Error('foo');
  } catch (err: Error) {
    const { message }: { message: string } = err;
    return {
      message: `Things exploded (${message})`,
    };
  }
  </code></pre>
  <h2>The Problem</h2>
  <p>When I run my linter, I receive the following:</p>
  <pre><code>  4:9  error  Unsafe assignment of an any value  @typescript-eslint/no-unsafe-assignment
  </code></pre>
  <p>This is confusing to me, since the error is typed (<code>Error</code>).</p>
  <h2>The Question</h2>
  <p>How can I catch an error in TypeScript and access the Error's properties?</p>