All files / src/utilities ErrorGenerator.js

100% Statements 4/4
25% Branches 1/4
100% Functions 1/1
100% Lines 4/4

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    6x 6x 6x 6x        
class ErrorGenerator extends Error {
    constructor(message = "Unexpected Error", statusCode = 500) {
        super(message);
        this.message = message;
        this.statusCode = statusCode;
        this.status = String(statusCode).startsWith("4") ? "Fail" : "Error";
    }
}
 
export default ErrorGenerator;