Skip to content

Commit

Permalink
fix: 🐛 warn users on missing mapped error keys
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharkazaz committed Nov 15, 2023
1 parent 05d4481 commit a206f74
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 a206f74

Please sign in to comment.