prisma-generator-express 1.26.0 → 1.27.0
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.
|
@@ -127,7 +127,7 @@ export function ${routerFunctionName}(config: RouteConfig = {}) {
|
|
|
127
127
|
if (qbEnabled) {
|
|
128
128
|
const qbConfig = getQueryBuilderConfig(config)
|
|
129
129
|
if (qbConfig) {
|
|
130
|
-
|
|
130
|
+
try { require('../queryBuilder').startQueryBuilder(qbConfig) } catch (err) { if (_env.NODE_ENV !== 'production') console.warn('[query-builder]', err) }
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -129,7 +129,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
129
129
|
"name" in error &&
|
|
130
130
|
error.name === "ShapeError"
|
|
131
131
|
) {
|
|
132
|
-
next(new HttpError(400, (error as
|
|
132
|
+
next(new HttpError(400, (error as any).message));
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -139,7 +139,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
139
139
|
"name" in error &&
|
|
140
140
|
error.name === "CallerError"
|
|
141
141
|
) {
|
|
142
|
-
next(new HttpError(400, (error as
|
|
142
|
+
next(new HttpError(400, (error as any).message));
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -149,7 +149,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
149
149
|
"name" in error &&
|
|
150
150
|
error.name === "PolicyError"
|
|
151
151
|
) {
|
|
152
|
-
next(new HttpError(403, (error as
|
|
152
|
+
next(new HttpError(403, (error as any).message));
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -163,7 +163,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
163
163
|
const issues = (error as any).issues;
|
|
164
164
|
const message = Array.isArray(issues)
|
|
165
165
|
? issues.map((i: any) => i.message).join("; ")
|
|
166
|
-
: (error as
|
|
166
|
+
: (error as any).message;
|
|
167
167
|
next(new HttpError(400, message));
|
|
168
168
|
return;
|
|
169
169
|
}
|
package/package.json
CHANGED
|
@@ -140,7 +140,7 @@ export function ${routerFunctionName}(config: RouteConfig = {}) {
|
|
|
140
140
|
if (qbEnabled) {
|
|
141
141
|
const qbConfig = getQueryBuilderConfig(config)
|
|
142
142
|
if (qbConfig) {
|
|
143
|
-
|
|
143
|
+
try { require('../queryBuilder').startQueryBuilder(qbConfig) } catch (err) { if (_env.NODE_ENV !== 'production') console.warn('[query-builder]', err) }
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -135,7 +135,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
135
135
|
"name" in error &&
|
|
136
136
|
error.name === "ShapeError"
|
|
137
137
|
) {
|
|
138
|
-
next(new HttpError(400, (error as
|
|
138
|
+
next(new HttpError(400, (error as any).message));
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -145,7 +145,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
145
145
|
"name" in error &&
|
|
146
146
|
error.name === "CallerError"
|
|
147
147
|
) {
|
|
148
|
-
next(new HttpError(400, (error as
|
|
148
|
+
next(new HttpError(400, (error as any).message));
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -155,7 +155,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
155
155
|
"name" in error &&
|
|
156
156
|
error.name === "PolicyError"
|
|
157
157
|
) {
|
|
158
|
-
next(new HttpError(403, (error as
|
|
158
|
+
next(new HttpError(403, (error as any).message));
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -169,7 +169,7 @@ function handleError(error: unknown, next: NextFunction): void {
|
|
|
169
169
|
const issues = (error as any).issues;
|
|
170
170
|
const message = Array.isArray(issues)
|
|
171
171
|
? issues.map((i: any) => i.message).join("; ")
|
|
172
|
-
: (error as
|
|
172
|
+
: (error as any).message;
|
|
173
173
|
next(new HttpError(400, message));
|
|
174
174
|
return;
|
|
175
175
|
}
|