Skip to content

Commit

Permalink
FindCriteriaNotFoundError must extend EntityColumnNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Sep 15, 2020
1 parent 51da0ab commit 0128a9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/error/FindCriteriaNotFoundError.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import {EntityMetadata} from "..";
import {EntityColumnNotFound} from "./EntityColumnNotFound";

/**
* Thrown when specified entity property in the find options were not found.
*/
export class FindCriteriaNotFoundError extends Error {
export class FindCriteriaNotFoundError extends EntityColumnNotFound {

constructor(propertyPath: string, metadata: EntityMetadata) {
super();
super(propertyPath);
Object.setPrototypeOf(this, FindCriteriaNotFoundError.prototype);
this.message = `Property "${propertyPath}" was not found in ${metadata.targetName}. Make sure your query is correct.`;
}

}
}

0 comments on commit 0128a9e

Please sign in to comment.