You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`setFix()`][error-method-setfix]| Sets the fix a possible solution to the described [`problem`][error-property-problem]. |
174
-
|[`setMessage()`][error-method-setmessage]| Sets the validation error message of a [`string`][js-string] type from the provided `message` of the [`ErrorMessage`](#errormessage) interface. |
175
-
|[`setProblem()`][error-method-setproblem]| Sets description problem of a [`ValidationError`](#validationerror). |
176
-
|[`setTemplate()`][error-method-settemplate]| Sets the template of validation error message. |
177
-
|[`throw()`][error-method-throw]| Throws an error of [`ValidationError`](#validationerror) with actual settings. |
|[`setFix()`][error-method-setfix]| Sets the fix a possible solution to the described [`problem`][error-property-problem]. |
175
+
|[`setMessage()`][error-method-setmessage]| Sets the validation error message of a [`string`][js-string] type from the provided `message` of the [`ErrorMessage`](#errormessage) interface. |
176
+
|[`setProblem()`][error-method-setproblem]| Sets description problem of a [`ValidationError`](#validationerror). |
177
+
|[`setTemplate()`][error-method-settemplate]| Sets the template of validation error message. |
178
+
|[`throw()`][error-method-throw]| Throws an error of [`ValidationError`](#validationerror) with actual settings. |
179
+
|[`updateMessage()`][error-method-updatemessage]| Updates the message with a stored [`fix`][error-property-fix], [`problem`][error-property-problem], and [`template`][error-property-template]. |
|`message: ErrorMessage`| An [`object`][js-object] of the [`ErrorMessage`](#errormessage) interface to build a message of a [`string`][js-string] type. The value is checked against the proper [`object`][js-object]|
304
-
|`template: string`| A message template of a [`string`][js-string] type with replaceable `[problem]` and `[fix]` from the given `message`. The value is checked against a [`string`][js-string]. By default, it's set to `Problem: [problem] => Fix: [fix]`|
305
307
|`callback?: ResultCallback`| An optional callback function of [`ResultCallback`][package-callback-resultcallback] type to handle the check whether the provided message contains required `problem` and `fix` properties |
306
308
307
309
**Returns:**
@@ -444,7 +446,57 @@ const validationError = new ValidationError({ fix, problem });
|`fix: string`| A possible solution to the described problem guarded by a [`string`][js-string] type. |
482
-
|`callback?: ResultCallback<CallbackPayload>`| An optional callback function of [`ResultCallback`][package-callback-resultcallback] type to handle the check whether the provided [`fix`][error-property-fix] is a [`string`][js-string]. |
534
+
|`callback?: ResultCallback<CallbackPayload>`| An optional callback function of [`ResultCallback`][package-callback-resultcallback] type to handle the check whether the provided [`fix`][error-property-fix] is a [`string`][js-string]. It can be initially set by callback |
483
535
484
536
**Returns:**
485
537
@@ -796,6 +848,68 @@ validationError.throw();
796
848
797
849
<br>
798
850
851
+
#### `ValidationError.prototype.updateMessage()`
852
+
853
+
![new]
854
+
855
+
Updates the message with a stored [`fix`][error-property-fix], [`problem`][error-property-problem], and [`template`][error-property-template].
856
+
857
+
```typescript
858
+
publicupdateMessage(): void {
859
+
this.message=ValidationError.defineMessage({
860
+
fix: this.#fix,
861
+
problem: this.#problem,
862
+
template: this.#tpl,
863
+
});
864
+
}
865
+
```
866
+
867
+
**Returns:**
868
+
869
+
The **return value** is an instance of an [`ValidationError`](#validationerror).
0 commit comments