title: How to return an error message from BaseController derived class
body: <p>Is there a way of returning a customized error message from <code>BaseController</code> derived class to the client like e.g:</p>
  <pre><code> NotFound(&quot;Function :&quot; + scheduleReq.UserFunction + &quot; for date: &quot; + scheduleReq.Date + &quot; already taken&quot;);
  </code></pre>
  <p>Unfortunately <code>NotFound</code> return value does not convey my message to the client.
  I would like to get my message in <code>error</code> variable like below:</p>
  <p>Client:</p>
  <pre><code>this.accountService.GetScheduleFromPool(this.account.id, schedule)
        .pipe(first())
        .subscribe({
          next: (account) =&gt; {
            this.addingSchedule = false;
  
            console.log(account);
            this.schedules = account.schedules;
            
  
            if (this.poolElements.length != 0) {
              this.form.get('availableScheduledDate').setValue(this.poolElements[0].date);
              this.form.get('availableFunction').setValue(this.poolElements[0].userFunction);
            }
            this.updateSchedulesAndPoolFromServer();
          },
          error: error =&gt; {
            this.addingSchedule = false;
  
            this.alertService.error(error);
          }
        });
  </code></pre>