badmfck-api-server 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -317,6 +317,8 @@ class MysqlAdapter {
|
|
317
317
|
}
|
318
318
|
async query(request, conn) {
|
319
319
|
const query = this.prepareQuery(request);
|
320
|
+
if (this.options.debug || request.debug)
|
321
|
+
(0, LogService_1.logDB)(query);
|
320
322
|
if (request.parseQueryOnly) {
|
321
323
|
return {
|
322
324
|
data: [{ query }],
|
@@ -12,6 +12,15 @@ declare class DefaultErrors {
|
|
12
12
|
static TIMEOUT: IError;
|
13
13
|
static METHOD_NOT_ALLOWED: IError;
|
14
14
|
static DB_ERROR: IError;
|
15
|
+
static FORBIDDEN: IError;
|
16
|
+
static NOT_FOUND: IError;
|
17
|
+
static INTERNAL_SERVER_ERROR: IError;
|
18
|
+
static INVALID_TOKEN: IError;
|
19
|
+
static INVALID_CREDENTIALS: IError;
|
20
|
+
static INVALID_DATA: IError;
|
21
|
+
static INVALID_FILE: IError;
|
22
|
+
static WRONG_DATA_TYPE: IError;
|
23
|
+
static UPROCESSIABLE_CONTENT: IError;
|
15
24
|
}
|
16
25
|
export declare class ErrorUtils {
|
17
26
|
static isError(obj: any): obj is IError;
|
@@ -12,9 +12,18 @@ class DefaultErrors {
|
|
12
12
|
static UNAUTHORIZED = { code: 6, message: "Unauthorized" };
|
13
13
|
static BAD_REQUEST = { code: 7, message: "Bad request", httpStatus: 400 };
|
14
14
|
static SERVICE_NOT_WORKING = { code: 8, message: "Service not working" };
|
15
|
-
static TIMEOUT = { code: 9, message: "Timeout" };
|
15
|
+
static TIMEOUT = { code: 9, message: "Timeout", httpStatus: 408 };
|
16
16
|
static METHOD_NOT_ALLOWED = { code: 10, message: "Method not allowed", httpStatus: 405 };
|
17
17
|
static DB_ERROR = { code: 11, message: "DB error", httpStatus: 500 };
|
18
|
+
static FORBIDDEN = { code: 12, message: "Forbidden", httpStatus: 403 };
|
19
|
+
static NOT_FOUND = { code: 13, message: "Not found", httpStatus: 404 };
|
20
|
+
static INTERNAL_SERVER_ERROR = { code: 14, message: "Internal server error", httpStatus: 500 };
|
21
|
+
static INVALID_TOKEN = { code: 15, message: "Invalid token", httpStatus: 401 };
|
22
|
+
static INVALID_CREDENTIALS = { code: 16, message: "Invalid credentials", httpStatus: 401 };
|
23
|
+
static INVALID_DATA = { code: 17, message: "Invalid data", httpStatus: 422 };
|
24
|
+
static INVALID_FILE = { code: 18, message: "Invalid file", httpStatus: 422 };
|
25
|
+
static WRONG_DATA_TYPE = { code: 23, message: "Wrong data type", httpStatus: 422 };
|
26
|
+
static UPROCESSIABLE_CONTENT = { code: 29, message: "Unprocessable content", httpStatus: 422 };
|
18
27
|
}
|
19
28
|
class ErrorUtils {
|
20
29
|
static isError(obj) {
|