• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ialopezg / corejs / #5

03 Nov 2023 08:38PM UTC coverage: 42.153% (-47.5%) from 89.623%
#5

push

ialopezg
feat: add microservice feature

10 of 84 branches covered (0.0%)

Branch coverage included in aggregate %.

49 of 77 new or added lines in 20 files covered. (63.64%)

155 existing lines in 21 files now uncovered.

221 of 464 relevant lines covered (47.63%)

0.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.36
/src/core/exceptions/handler.ts
1
import { Response } from 'express';
2

3
import { HttpException } from './http-exception';
1✔
4
import { messages } from '../constants';
1✔
5
import { LoggerService } from '../../common';
1✔
6

7
/**
8
 * Application error handler.
9
 */
10
export class ExceptionHandler {
1✔
NEW
11
  private readonly logger = new LoggerService(ExceptionHandler.name);
×
12

13
  /**
14
   * On error go to next with error data.
15
   *
16
   * @param {Error|HttpException} exception Error occurred.
17
   * @param {Response} response Response data.
18
   */
19
  next(exception: Error | HttpException, response: Response) {
UNCOV
20
    if (!(exception instanceof HttpException)) {
×
NEW
21
      this.logger.error(exception.message, exception.stack);
×
22

NEW
23
      return response.status(500).json({
×
24
        message: messages.UNKNOWN_EXCEPTION,
25
      });
26
    }
27

UNCOV
28
    response.status(exception.status).json({
×
29
      message: exception.message,
30
    });
31
  }
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc