title: What is the nestjs error handling approach (business logic error vs. http error)?
body: <p>While using NestJS to create API's I was wondering which is the best way to handle errors/exception.
  I have found two different approaches :</p>
  <ol>
  <li>Have individual services and validation pipes <code>throw new Error()</code>, have the controller <code>catch</code> them and then throw the appropriate kind of <code>HttpException</code>(<code>BadRequestException</code>, <code>ForbiddenException</code> etc..)</li>
  <li>Have the controller simply call the service/validation pipe method responsible for handling that part of business logic, and throw the appropriate <code>HttpException</code>.</li>
  </ol>
  <p>There are pros and cons to both approaches:</p>
  <ol>
  <li>This seems the right way, however, the service can return <code>Error</code> for different reasons, how do I know from the controller which would be the corresponding kind of <code>HttpException</code> to return?</li>
  <li>Very flexible, but having <code>Http</code> related stuff in services just seems wrong.</li>
  </ol>
  <p>I was wondering, which one (if any) is the &quot;nest js&quot; way of doing it?</p>
  <p>How do you handle this matter?</p>