UNPKG

1.26 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var index_1 = require("../index");
5/**
6 * Thrown when repository for the given class is not found.
7 */
8var RepositoryNotFoundError = /** @class */ (function (_super) {
9 tslib_1.__extends(RepositoryNotFoundError, _super);
10 function RepositoryNotFoundError(connectionName, entityClass) {
11 var _this = _super.call(this) || this;
12 _this.name = "RepositoryNotFoundError";
13 Object.setPrototypeOf(_this, RepositoryNotFoundError.prototype);
14 var targetName;
15 if (entityClass instanceof index_1.EntitySchema) {
16 targetName = entityClass.options.name;
17 }
18 else if (typeof entityClass === "function") {
19 targetName = entityClass.name;
20 }
21 else {
22 targetName = entityClass;
23 }
24 _this.message = "No repository for \"" + targetName + "\" was found. Looks like this entity is not registered in " +
25 ("current \"" + connectionName + "\" connection?");
26 return _this;
27 }
28 return RepositoryNotFoundError;
29}(Error));
30exports.RepositoryNotFoundError = RepositoryNotFoundError;
31
32//# sourceMappingURL=RepositoryNotFoundError.js.map