1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.isInvalidRelationError = exports.InvalidRelationError = void 0;
|
8 | class InvalidRelationError extends Error {
|
9 | constructor(reason, relationMeta, extraProperties) {
|
10 | const { name, type, source } = relationMeta;
|
11 | const model = (source === null || source === void 0 ? void 0 : source.modelName) || '<Unknown Model>';
|
12 | const message = `Invalid ${type} definition for ${model}#${name}: ${reason}`;
|
13 | super(message);
|
14 | Error.captureStackTrace(this, this.constructor);
|
15 | this.code = 'INVALID_RELATION_DEFINITION';
|
16 | this.relationName = name;
|
17 | this.relationType = type;
|
18 | this.sourceModelName = model;
|
19 | Object.assign(this, extraProperties);
|
20 | }
|
21 | }
|
22 | exports.InvalidRelationError = InvalidRelationError;
|
23 |
|
24 | function isInvalidRelationError(e) {
|
25 | return e instanceof InvalidRelationError;
|
26 | }
|
27 | exports.isInvalidRelationError = isInvalidRelationError;
|
28 |
|
\ | No newline at end of file |