All files notFoundError.ts

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x   1x     8x     8x     8x      
import { BaseError } from './baseError';
 
export class NotFoundError extends BaseError {
    constructor(message: string = 'Not Found', status: number = 404) {
        // Calling parent constructor of base Error class.
        super(message, status, 'not_found_error');
 
        // Capturing stack trace, excluding constructor call from it.
        Error.captureStackTrace(this, this.constructor);
 
        // Saving class name in the property of our custom error as a shortcut.
        this.name = this.constructor.name;
    }
}