title: SignalR: Throwing HubException on server and getting the error message on typescript client
body: <p>Starting the connection client-side:</p>
  
  <pre><code>ngOnInit() {
      this._gameKey = parseInt(this._route.snapshot.paramMap.get('game-key'));
  
      this._hubConnection = new HubConnectionBuilder()
                            .withUrl('http://localhost:5000/match').build();
  
      this._hubConnection.on('Connected', (data) =&gt; {this.connected(data)});
  
      ...
  
      this._hubConnection
        .start()
        .then(() =&gt; {})
        .catch(err =&gt; console.log(err));
  }
  </code></pre>
  
  <p>Here is the back-end method I'm invoking:   </p>
  
  <pre><code>public async Task SendResources(string gameKey) {
        throw new HubException("oops");
        ...
  }
  </code></pre>
  
  <p>In my typescript client I have:</p>
  
  <pre><code>public connected(data): void {    
    this._hubConnection.invoke('SendResources', this._gameKey).catch(this.errorHandler);
  }
  
  public errorHandler(err): void {
    console.log(err);
  }
  </code></pre>
  
  <p>The execution flow enters 'errorHandler' with 'err' being of type Error. The problem is that I can't access the message of the exception. All info I get from the 'err' variable is this:</p>
  
  <p><a href="https://i.stack.imgur.com/6kTVe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6kTVe.png" alt="enter image description here"></a></p>
  
  <p>Any Idea how to handle error messages correctly with signalR?</p>
  
  <h2>Versions:</h2>
  
  <p>.net core: 2.1<br>
  angular: 5<br>
  @aspnet/signalr: 1.0.0</p>