Skip to content

Commit e6fb177

Browse files
docs(README.md): update.
1 parent bcc6521 commit e6fb177

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Manages an [`Error`][js-error] of validation.
192192

193193
![update]
194194

195-
A template of the error message guarded by [`string`][js-string] type with the replaceable `[problem]` and `[fix]` words. By default, it's set to `Problem: [problem] => Fix: [fix]`.
195+
A template of the error message guarded by [`string`][js-string] type with the replaceable `[problem]` and `[fix]` words. By default, it's set to `Problem: [problem] => Fix: [fix]`. It can be set directly or by the [`setTemplate()`][error-method-settemplate] and [`setMessage()`][error-method-setmessage] method.
196196

197197
```typescript
198198
static get template(): string {
@@ -215,7 +215,7 @@ static set template(value: string) {
215215

216216
![update]
217217

218-
A possible solution to the described [`problem`][error-property-problem] of validation that is guarded by a [`string`][js-string] type. By default, it's an empty [`string`][js-string].
218+
A possible solution to the described [`problem`][error-property-problem] of validation that is guarded by a [`string`][js-string] type. By default, it's an empty [`string`][js-string]. It can be set directly or by the [`setFix()`][error-method-setfix] and [`setMessage()`][error-method-setmessage] method.
219219

220220
```typescript
221221
public get fix(): string {
@@ -230,7 +230,9 @@ public set fix(value: string) {
230230

231231
#### `ValidationError.prototype.message`
232232

233-
A validation error message guarded by a [`string`][js-string] type that can be build from the [`problem`][error-property-problem] and [`fix`][error-property-fix] of [`ValidationError`](#validationerror) on the [`template`][error-property-template].
233+
![update]
234+
235+
A validation error message guarded by a [`string`][js-string] type that can be build from the [`problem`][error-property-problem] and [`fix`][error-property-fix] of [`ValidationError`](#validationerror) on the [`template`][error-property-template]. It can be set directly or by the [`throw()`][error-method-throw] and [`setMessage()`][error-method-setmessage] method.
234236

235237
```typescript
236238
public set message(value: string) {
@@ -245,8 +247,6 @@ public get message(): string {
245247

246248
#### `ValidationError.prototype.name`
247249

248-
![update]
249-
250250
Error name of a [`string`][js-string] type that is being thrown. By default, it's ['ValidationError'](#validationerror).
251251

252252
```typescript
@@ -259,7 +259,7 @@ public name = ValidationError.name;
259259

260260
![update]
261261

262-
Description of a validation [`problem`][error-property-problem] guarded by a [`string`][js-string] type. By default, it's an empty [`string`][js-string].
262+
Description of a validation [`problem`][error-property-problem] guarded by a [`string`][js-string] type. By default, it's an empty [`string`][js-string]. It can be set directly or by the [`setProblem()`][error-method-setproblem] and [`setMessage()`][error-method-setmessage] method.
263263

264264
```typescript
265265
public get problem(): string {
@@ -283,6 +283,7 @@ public set problem(value: string) {
283283
Defines the validation error message of a [`string`][js-string] type from the provided `message` of the [`ErrorMessage`](#errormessage) interface.
284284

285285
```typescript
286+
// Syntax.
286287
public static defineMessage(
287288
message: ErrorMessage,
288289
callback?: ResultCallback<CallbackPayload & ErrorMessage>
@@ -401,6 +402,7 @@ const errorMessage = ValidationError.defineMessage(
401402
Creates a new instance with the message. If the provided `message` is an [`object`][js-object], then its properties are assigned to the instance.
402403

403404
```typescript
405+
// Syntax.
404406
constructor(
405407
message: string | ErrorMessage = '',
406408
callback?: (callback: Callback<AllowedCallback>) => void

0 commit comments

Comments
 (0)