UNPKG

1.61 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/error/RepositoryNotFoundError.ts"],"names":[],"mappings":";;;AAAA,kCAAsC;AAEtC;;GAEG;AACH;IAA6C,mDAAK;IAG9C,iCAAY,cAAsB,EAAE,WAA8C;QAAlF,YACI,iBAAO,SAYV;QAfD,UAAI,GAAG,yBAAyB,CAAC;QAI7B,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,UAAkB,CAAC;QACvB,IAAI,WAAW,YAAY,oBAAY,EAAE;YACrC,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SACzC;aAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YAC1C,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC;SACjC;aAAM;YACH,UAAU,GAAG,WAAW,CAAC;SAC5B;QACD,KAAI,CAAC,OAAO,GAAG,yBAAsB,UAAU,+DAA2D;aACtG,eAAY,cAAc,mBAAe,CAAA,CAAC;;IAClD,CAAC;IAEL,8BAAC;AAAD,CAlBA,AAkBC,CAlB4C,KAAK,GAkBjD;AAlBY,0DAAuB","file":"RepositoryNotFoundError.js","sourcesContent":["import {EntitySchema} from \"../index\";\n\n/**\n * Thrown when repository for the given class is not found.\n */\nexport class RepositoryNotFoundError extends Error {\n name = \"RepositoryNotFoundError\";\n\n constructor(connectionName: string, entityClass: Function|EntitySchema<any>|string) {\n super();\n Object.setPrototypeOf(this, RepositoryNotFoundError.prototype);\n let targetName: string;\n if (entityClass instanceof EntitySchema) {\n targetName = entityClass.options.name;\n } else if (typeof entityClass === \"function\") {\n targetName = entityClass.name;\n } else {\n targetName = entityClass;\n }\n this.message = `No repository for \"${targetName}\" was found. Looks like this entity is not registered in ` +\n `current \"${connectionName}\" connection?`;\n }\n\n}"],"sourceRoot":".."}
\No newline at end of file