title: NestJs - Send Response from Exception Filter
body: <p>I'm trying to achieve a simple behavior: Whenever an exception is thrown I would like to send the error as a response. My kind of naive code looks like this, but doesn't respond at all:</p>
  
  <p><strong>Exception Filter:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import { ExceptionFilter, ArgumentsHost, Catch } from '@nestjs/common';
  
  @Catch()
  export class AnyExceptionFilter implements ExceptionFilter {
    catch(exception: any, host: ArgumentsHost) {
      return JSON.stringify(
        {
          error: exception,
        },
        null,
        4,
      );
    }
  }
  </code></pre>
  
  <p><strong>Module</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>@Module({
    imports: [],
    controllers: [AppController, TestController],
    providers: [AppService, AnyExceptionFilter],
  })
  export class AppModule {}
  </code></pre>
  
  <p><strong>main.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>async function bootstrap() {
    const app = await NestFactory.create(AppModule);
    app.useGlobalFilters(new AnyExceptionFilter());
    await app.listen(1212);
  }
  bootstrap();
  </code></pre>
  
  <p>Is there anything I miss? Thanks in advance :)</p>