Skip to content

Commit

Permalink
Merge pull request #109 from ngneat/add-warning-for-missing-error-keys
Browse files Browse the repository at this point in the history
fix: 🐛 warn users on missing mapped error keys
  • Loading branch information
shaharkazaz authored Nov 15, 2023
2 parents 05d4481 + a206f74 commit 9b12ce1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
EmbeddedViewRef,
Inject,
Input,
isDevMode,
OnDestroy,
OnInit,
Optional,
Expand Down Expand Up @@ -188,6 +189,9 @@ export class ControlErrorsDirective implements OnInit, OnDestroy {
const [firstKey] = Object.keys(controlErrors);
const getError = this.customErrors[firstKey] || this.globalErrors[firstKey];
if (!getError) {
if (isDevMode()) {
console.warn(`[@ngneat/error-tailor]: Missing error message for ${firstKey}`);
}
return;
}

Expand Down

0 comments on commit 9b12ce1

Please sign in to comment.