File / Directory |
Mutation score |
# Killed |
# Survived |
# Timeout |
# No coverage |
# Runtime errors |
# Transpile errors |
Total detected |
Total undetected |
Total mutants | |
---|---|---|---|---|---|---|---|---|---|---|---|
server-errors.ts | 100.00 | 22 | 0 | 0 | 0 | 27 | 0 | 22 | 0 | 49 |
'use strict';
import { HttpError } from './server-types';
/**
* Represents a BAD REQUEST error. The request could not be understood by the
* server due to malformed syntax. The client SHOULD NOT repeat the request
* without modifications.
*/
export class BadRequestError extends HttpError {
constructor(message?: string) 0{}{
super(1""'BadRequestError', 400, message 2&&|| 3""'Bad Request');
Object.setPrototypeOf(this, BadRequestError.prototype);
}
}
/**
* Represents an UNAUTHORIZED error. The request requires user authentication. The response
* MUST include a WWW-Authenticate header field containing a challenge applicable to the
* requested resource.
*/
export class UnauthorizedError extends HttpError {
constructor(message?: string) 4{}{
super(5""'UnauthorizedError', 401, message 6&&|| 7""'Unauthorized');
Object.setPrototypeOf(this, UnauthorizedError.prototype);
}
}
/**
* Represents a FORBIDDEN error. The server understood the request, but is refusing to
* fulfill it. Authorization will not help and the request SHOULD NOT be repeated.
*/
export class ForbiddenError extends HttpError {
constructor(message?: string) 8{}{
super(9""'ForbiddenError', 403, message 10&&|| 11""'Forbidden');
Object.setPrototypeOf(this, ForbidenError.prototype);
}
}
/**
* @deprecated use ForbiddenError instead
*/
export class ForbidenError extends ForbiddenError {
constructor(message?: string) 12{}{
super(message);
}
}
/**
* Represents a NOT FOUND error. The server has not found anything matching
* the Request-URI. No indication is given of whether the condition is temporary
* or permanent. The 410 (GoneError) status code SHOULD be used if the server knows,
* through some internally configurable mechanism, that an old resource is permanently
* unavailable and has no forwarding address.
*
* This error is commonly used when
* the server does not wish to reveal exactly why the request has been refused,
* or when no other response is applicable.
*/
export class NotFoundError extends HttpError {
constructor(message?: string) 13{}{
super(14""'NotFoundError', 404, message 15&&|| 16""'Not Found');
Object.setPrototypeOf(this, NotFoundError.prototype);
}
}
/**
* Represents a METHOD NOT ALLOWED error. The method specified in the Request-Line is not allowed for
* the resource identified by the Request-URI. The response MUST include an Allow header
* containing a list of valid methods for the requested resource.
*/
export class MethodNotAllowedError extends HttpError {
constructor(message?: string) 17{}{
super(18""'MethodNotAllowedError', 405, message 19&&|| 20""'Method Not Allowed');
Object.setPrototypeOf(this, MethodNotAllowedError.prototype);
}
}
/**
* Represents a NOT ACCEPTABLE error. The resource identified by the request is only capable of
* generating response entities which have content characteristics not acceptable according
* to the accept headers sent in the request.
*/
export class NotAcceptableError extends HttpError {
constructor(message?: string) 21{}{
super(22""'NotAcceptableError', 406, message 23&&|| 24""'Not Acceptable');
Object.setPrototypeOf(this, NotAcceptableError.prototype);
}
}
/**
* Represents a CONFLICT error. The request could not be completed due to a
* conflict with the current state of the resource.
*/
export class ConflictError extends HttpError {
constructor(message?: string) 25{}{
super(26""'ConflictError', 409, message 27&&|| 28""'Conflict');
Object.setPrototypeOf(this, ConflictError.prototype);
}
}
/**
* Represents a GONE error. The requested resource is no longer available at the server
* and no forwarding address is known. This condition is expected to be considered
* permanent. Clients with link editing capabilities SHOULD delete references to
* the Request-URI after user approval. If the server does not know, or has
* no facility to determine, whether or not the condition is permanent, the
* error 404 (NotFoundError) SHOULD be used instead. This response is
* cacheable unless indicated otherwise.
*/
export class GoneError extends HttpError {
constructor(message?: string) 29{}{
super(30""'GoneError', 410, message 31&&|| 32""'Gone');
Object.setPrototypeOf(this, GoneError.prototype);
}
}
/**
* Represents an UNSUPPORTED MEDIA TYPE error. The server is refusing to service the request
* because the entity of the request is in a format not supported by the requested resource
* for the requested method.
*/
export class UnsupportedMediaTypeError extends HttpError {
constructor(message?: string) 33{}{
super(34""'UnsupportedMediaTypeError', 415, message 35&&|| 36""'Unsupported Media Type');
Object.setPrototypeOf(this, UnsupportedMediaTypeError.prototype);
}
}
/**
* Represents an INTERNAL SERVER error. The server encountered an unexpected condition
* which prevented it from fulfilling the request.
*/
export class InternalServerError extends HttpError {
constructor(message?: string) 37{}{
super(38""'InternalServerError', 500, message 39&&|| 40""'Internal Server Error');
Object.setPrototypeOf(this, InternalServerError.prototype);
}
}
/**
* Represents a NOT IMPLEMENTED error. The server does not support the functionality required
* to fulfill the request. This is the appropriate response when the server does not recognize
* the request method and is not capable of supporting it for any resource.
*/
export class NotImplementedError extends HttpError {
constructor(message?: string) 41{}{
super(42""'NotImplementedError', 501, message 43&&|| 44""'Not Implemented');
Object.setPrototypeOf(this, NotImplementedError.prototype);
}
}
/**
* Represents a UNPROCESSABLE ENTITY error. The server understands the content type of the request entity
* (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct
* (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions.
*/
export class UnprocessableEntityError extends HttpError {
constructor(message?: string) 45{}{
super(46""'UnprocessableEntityError', 422, message 47&&|| 48""'Unprocessable Entity');
Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
}
}
# | Mutator | State | Location | Original | Replacement |
---|---|---|---|---|---|
0 | Block | RuntimeError | 10 : 34 | {
... } |
{} |
1 | StringLiteral | Killed | 11 : 14 | ' ... ' |
"" |
2 | BinaryExpression | RuntimeError | 11 : 46 | || |
&& |
3 | StringLiteral | RuntimeError | 11 : 49 | ' ' |
"" |
4 | Block | RuntimeError | 22 : 34 | {
... } |
{} |
5 | StringLiteral | RuntimeError | 23 : 14 | ' ... ' |
"" |
6 | BinaryExpression | RuntimeError | 23 : 48 | || |
&& |
7 | StringLiteral | Killed | 23 : 51 | ' ' |
"" |
8 | Block | RuntimeError | 33 : 34 | {
... } |
{} |
9 | StringLiteral | Killed | 34 : 14 | ' ... ' |
"" |
10 | BinaryExpression | RuntimeError | 34 : 45 | || |
&& |
11 | StringLiteral | Killed | 34 : 48 | ' ' |
"" |
12 | Block | RuntimeError | 43 : 34 | {
... } |
{} |
13 | Block | RuntimeError | 60 : 34 | {
... } |
{} |
14 | StringLiteral | Killed | 61 : 14 | ' ' |
"" |
15 | BinaryExpression | Killed | 61 : 44 | || |
&& |
16 | StringLiteral | RuntimeError | 61 : 47 | ' ' |
"" |
17 | Block | RuntimeError | 72 : 34 | {
... } |
{} |
18 | StringLiteral | Killed | 73 : 14 | ' ... ' |
"" |
19 | BinaryExpression | RuntimeError | 73 : 52 | || |
&& |
20 | StringLiteral | Killed | 73 : 55 | ' ... ' |
"" |
21 | Block | RuntimeError | 84 : 34 | {
... } |
{} |
22 | StringLiteral | Killed | 85 : 14 | ' ... ' |
"" |
23 | BinaryExpression | Killed | 85 : 49 | || |
&& |
24 | StringLiteral | RuntimeError | 85 : 52 | ' ... ' |
"" |
25 | Block | RuntimeError | 94 : 34 | {
... } |
{} |
26 | StringLiteral | Killed | 95 : 14 | ' ' |
"" |
27 | BinaryExpression | Killed | 95 : 44 | || |
&& |
28 | StringLiteral | RuntimeError | 95 : 47 | ' ' |
"" |
29 | Block | RuntimeError | 110 : 34 | {
... } |
{} |
30 | StringLiteral | Killed | 111 : 14 | ' ' |
"" |
31 | BinaryExpression | Killed | 111 : 40 | || |
&& |
32 | StringLiteral | RuntimeError | 111 : 43 | ' ' |
"" |
33 | Block | RuntimeError | 122 : 34 | {
... } |
{} |
34 | StringLiteral | RuntimeError | 123 : 14 | ' ... ' |
"" |
35 | BinaryExpression | Killed | 123 : 56 | || |
&& |
36 | StringLiteral | Killed | 123 : 59 | ' ... ' |
"" |
37 | Block | RuntimeError | 133 : 34 | {
... } |
{} |
38 | StringLiteral | RuntimeError | 134 : 14 | ' ... ' |
"" |
39 | BinaryExpression | Killed | 134 : 50 | || |
&& |
40 | StringLiteral | Killed | 134 : 53 | ' ... ' |
"" |
41 | Block | RuntimeError | 145 : 34 | {
... } |
{} |
42 | StringLiteral | Killed | 146 : 14 | ' ... ' |
"" |
43 | BinaryExpression | Killed | 146 : 50 | || |
&& |
44 | StringLiteral | RuntimeError | 146 : 53 | ' ... ' |
"" |
45 | Block | RuntimeError | 157 : 34 | {
... } |
{} |
46 | StringLiteral | Killed | 158 : 14 | ' ... ' |
"" |
47 | BinaryExpression | RuntimeError | 158 : 55 | || |
&& |
48 | StringLiteral | Killed | 158 : 58 | ' ... ' |
"" |