title: Custom TypeORM errors in NestJS Service
body: <p>I am playing around with <code>NestJS</code> and I would like to take the error thrown from <code>TypeORM</code> and convert it into a shape that I can control.</p>
  <p>Right now, I'm just trying to catch the error thrown from <code>TypeORM</code> and log it out to see that my custom filter is working correctly. But unfortunately, my <code>console.log</code> statement in the filter is never logging.</p>
  <p>Here is a slimmed down version of my service and filter</p>
  <p>user.service.ts</p>
  <pre class="lang-js prettyprint-override"><code>export class UserService {
    constructor(
      @InjectRepository(Users)
      private readonly userRepository: Repository&lt;Users&gt;,
    ) {}
  
    @UseFilters(new TypeOrmFilter())
    async create(createUserDto: CreateUserDto) {
      const user = this.userRepository.create(createUserDto);
      return this.userRepository.save(user);
    }
  }
  </code></pre>
  <p>type-orm-filter.ts</p>
  <pre class="lang-js prettyprint-override"><code>@Catch()
  export class TypeOrmFilter implements ExceptionFilter {
    catch(exception: Error, host: ArgumentsHost) {
      console.log('\nI have caught an error\n', exception);
      throw exception;
    }
  }
  </code></pre>
  <p>Here is the log output from the error being thrown by <code>TypeORM</code></p>
  <pre class="lang-sh prettyprint-override"><code>[Nest] 61496   - 04/11/2021, 9:01:42 PM   [ExceptionsHandler] invalid input syntax for type uuid: &quot;123e4567&quot; +2482ms
  QueryFailedError: invalid input syntax for type uuid: &quot;123e4567&quot;
      at new QueryFailedError (my-nest-project/error-project-nestjs/node_modules/typeorm/error/QueryFailedError.js:11:28)
      at PostgresQueryRunner.&lt;anonymous&gt; (my-nest-project/error-project-nestjs/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:247:31)
      at step (my-nest-project/error-project-nestjs/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
      at Object.throw (my-nest-project/error-project-nestjs/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
      at rejected (my-nest-project/error-project-nestjs/node_modules/typeorm/node_modules/tslib/tslib.js:113:69)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
  </code></pre>