pg-mvc-service 2.0.39 → 2.0.40
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.
|
@@ -354,6 +354,9 @@ class TableModel {
|
|
|
354
354
|
throwUnprocessableException(code, message) {
|
|
355
355
|
throw new Exception_1.UnprocessableException(`${this.id}-${code}`, message);
|
|
356
356
|
}
|
|
357
|
+
throwNotFoundException(code, message) {
|
|
358
|
+
throw new Exception_1.NotFoundException(`${this.id}-${code}`, message);
|
|
359
|
+
}
|
|
357
360
|
validateOptions(options, isInsert, pkOrId) {
|
|
358
361
|
return __awaiter(this, void 0, void 0, function* () {
|
|
359
362
|
if (Object.keys(options).length === 0) {
|
package/package.json
CHANGED
package/src/models/TableModel.ts
CHANGED
|
@@ -4,7 +4,7 @@ import ValidateValueUtil from './SqlUtils/ValidateValueUtil';
|
|
|
4
4
|
import SelectExpression from './SqlUtils/SelectExpression';
|
|
5
5
|
import WhereExpression from './SqlUtils/WhereExpression';
|
|
6
6
|
import ValidateClient from './ValidateClient';
|
|
7
|
-
import { DbConflictException, UnprocessableException } from '../exceptions/Exception';
|
|
7
|
+
import { DbConflictException, NotFoundException, UnprocessableException } from '../exceptions/Exception';
|
|
8
8
|
import ExpressionClient from './ExpressionClient';
|
|
9
9
|
import UpdateExpression from './SqlUtils/UpdateExpression';
|
|
10
10
|
import MessageUtil, { TOptionErrorMessage } from './Utils/MessageUtil';
|
|
@@ -419,6 +419,10 @@ export class TableModel {
|
|
|
419
419
|
throw new UnprocessableException(`${this.id}-${code}`, message);
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
+
protected throwNotFoundException(code: string, message: string): never {
|
|
423
|
+
throw new NotFoundException(`${this.id}-${code}`, message);
|
|
424
|
+
}
|
|
425
|
+
|
|
422
426
|
protected async validateOptions(options: {[key: string]: any}, isInsert: boolean, pkOrId?: string | number | boolean | {[key: string]: any}): Promise<void> {
|
|
423
427
|
if (Object.keys(options).length === 0) {
|
|
424
428
|
throw new Error('At least one key-value pair is required in options.');
|