All files / app/errors bad-request-error.ts

100% Statements 3/3
100% Branches 1/1
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211x                             174x       1x  
import RestError from './rest-error';
 
/**
 * The error if a request is malformed.
 *
 * The request is most likely missing attributes or
 * attributes are not valid
 */
class BadRequestError extends RestError {
  /**
   * Creates an instance of this class.
   * @param message   - Message of the error
   * @param errorInfo - More error information
   */
  constructor(message = 'Bad Request', detail?: Record<string, unknown>) {
    super(400, message, detail);
  }
}
 
export default BadRequestError;