title: how to send error codes in nestjs app from controller?
body: <p>How can i send error codes in nestjs apart from 200? i tried to inject response object in a method but there is no method to send error.</p>
  <pre><code>save(@Body() body: any, @Res() response: Response): string {
      console.log(&quot;posting...&quot;)
      console.log(body)
      return &quot;saving &quot; + JSON.stringify(body)
  }
  </code></pre>
  <p>the above code send body with 20X status i want to send different status code like 400 or 500.</p>