• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

typeorm / typeorm / 19549987525

20 Nov 2025 08:11PM UTC coverage: 80.769% (+4.3%) from 76.433%
19549987525

push

github

web-flow
ci: run tests on commits to master and next (#11783)

Co-authored-by: Oleg "OSA413" Sokolov <OSA413@users.noreply.github.com>

26500 of 32174 branches covered (82.36%)

Branch coverage included in aggregate %.

91252 of 113615 relevant lines covered (80.32%)

88980.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/error/EntityNotFoundError.ts
1
import { EntityTarget } from "../common/EntityTarget"
26✔
2
import { TypeORMError } from "./TypeORMError"
26✔
3
import { ObjectUtils } from "../util/ObjectUtils"
26✔
4
import { InstanceChecker } from "../util/InstanceChecker"
26✔
5

26✔
6
/**
26✔
7
 * Thrown when no result could be found in methods which are not allowed to return undefined or an empty set.
26✔
8
 */
26✔
9
export class EntityNotFoundError extends TypeORMError {
26✔
10
    public readonly entityClass: EntityTarget<any>
26✔
11
    public readonly criteria: any
26✔
12

26✔
13
    constructor(entityClass: EntityTarget<any>, criteria: any) {
26✔
14
        super()
87✔
15

87✔
16
        this.entityClass = entityClass
87✔
17
        this.criteria = criteria
87✔
18

87✔
19
        this.message =
87✔
20
            `Could not find any entity of type "${this.stringifyTarget(
87✔
21
                entityClass,
87✔
22
            )}" ` + `matching: ${this.stringifyCriteria(criteria)}`
87✔
23
    }
87✔
24

26✔
25
    private stringifyTarget(target: EntityTarget<any>): string {
26✔
26
        if (InstanceChecker.isEntitySchema(target)) {
87!
27
            return target.options.name
×
28
        } else if (typeof target === "function") {
87✔
29
            return target.name
31✔
30
        } else if (ObjectUtils.isObject(target) && "name" in (target as any)) {
81!
31
            return (target as any).name
×
32
        } else {
56✔
33
            return target as any
56✔
34
        }
56✔
35
    }
87✔
36

26✔
37
    private stringifyCriteria(criteria: any): string {
26✔
38
        try {
87✔
39
            return JSON.stringify(criteria, null, 4)
87✔
40
        } catch (e) {}
87!
41
        return "" + criteria
×
42
    }
×
43
}
26✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc