UNPKG

1.09 kBJavaScriptView Raw
1/*
2 * Copyright (c) 2018 One Hill Technologies, LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17const HttpError = require ('./http-error');
18
19/**
20 * @class HttpError
21 *
22 * Base class for all http errors.
23 *
24 * @param statusCode Http status code
25 * @param code Error code
26 * @param message Error message
27 * @param details Optional details about the error
28 * @constructor
29 */
30class BadRequestError extends HttpError {
31 constructor (code, message, details) {
32 super (400, code, message, details);
33 }
34}
35
36module.exports = BadRequestError;