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
Copy file name to clipboardExpand all lines: i18n/es/docusaurus-plugin-content-docs/current/Concepts/error-handling.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ Es muy recomendable instalar un método global de gestión de errores en 4D Serv
21
21
22
22
:::
23
23
24
-
## Error o estado
24
+
## Predictable vs unpredictable errors
25
25
26
-
Muchas funciones de clase 4D, como `entity.save()` o `transporter.send()`, devuelven un objeto *status*. Este objeto se utiliza para almacenar errores "predecibles" en el contexto de ejecución, por ejemplo, una contraseña no válida, una entidad bloqueada, etc., que no detienen la ejecución del programa. Esta categoría de errores puede ser manejada por el código habitual.
26
+
Many 4D class functions, such as [`entity.save()`](../API/EntityClass.md#save) or [`transporter.send()`](../API/SMTPTransporterClass.md#send), return a object containing *status* information. This object is used to store **predictable** errors in the runtime context, e.g. invalid password, locked entity, etc., that do not require to stop program execution. This category of errors, also named **silent errors** errors, can be handled by regular code. When such errors occur in an error handling context, i.e. a [`Try`](#tryexpression), [`Try/Catch`](#trycatchend-try) or an [error-handling method](#installing-an-error-handling-method), they do not interrupt the execution and do not trigger the error handling (e.g. the `Catch` part of the [`Try/Catch`](#trycatchend-try) is not executed). They are not listed in the [`Last errors`](../commands/last-errors.md) collection. The error is only returned in the `status` and `statusText` properties of the returned object. It can be processed according to your business logic.
27
27
28
-
Otros errores "imprevisibles" son el error de escritura en el disco, el fallo de la red o, en general, cualquier interrupción inesperada. Esta categoría de errores genera excepciones definidas por [un *código*, un *mensaje* y una *firma*](#error-codes) y necesita ser manejada a través de un método de gestión de errores o una palabra clave `Try()`.
28
+
The other category of errors are **unpredictable** errors, also named **serious errors**. They include disk write error, network failure, or in general any unexpected interruption. This category of errors generates exceptions defined by [a *code*, a *message* and a *signature*](#error-codes). They interrupt the execution and trigger the error processing of the [`Try`](#tryexpression), [`Try/Catch`](#trycatchend-try) or [error-handling method](#installing-an-error-handling-method) features. They are listed in the [`Last errors`](../commands/last-errors.md) collection. Note that serious errors can also return values in the `status` and `statusText` properties, e.g. `dk status serious error` - "Other error".
Copy file name to clipboardExpand all lines: i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ Lea [**Novedades en 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), la ent
26
26
- Lenguaje 4D:
27
27
- New "trim" commands to remove leading and trailing spaces from a string: [`Trim`](../commands/trim.md), [`Trim start`](../commands/trim-start.md), and [`Trim end`](../commands/trim-end.md).
28
28
- Los comandos [`Num`](../commands/num.md) y [`String`](../commands/string.md) han sido actualizados para soportar conversiones en diferentes bases (radix).
29
+
-[**Fixed bug list**](https://bugs.4d.fr/fixedbugslist?version=21): list of all bugs that have been fixed in 4D 21.
| errCode | Integer | Same as for [`Last errors`](../commands/last-errors.md) command | Sí |
108
-
| message | Text | Same as for [`Last errors`](../commands/last-errors.md) command | Sí |
109
-
| extraDescription | Object | Free information to set up | Sí |
110
-
| seriousError | Boolean | Used only with validate events (see below). Will insert a specific `status` value in the [`save()`](../API/EntityClass.md#save) or [`drop()`](../API/EntityClass.md#drop) function:<li>If true:`dk status serious validation error`</li><li>If false: `dk status validation failed`</li> | Yes (default is false) |
111
-
| componentSignature | Text | Always "DBEV" | No |
112
-
113
-
-The errors are stacked in the `errors` collection property of the **Result object** returned by the [`save()`](../API/EntityClass.md#save) or [`drop()`](../API/EntityClass.md#drop) functions.
114
-
- In case of an error triggered by a **validate** event, the `fatalError` property allows you to insert a specific `status` and its associated `statusText` in the **Result object** returned by the [`save()`](../API/EntityClass.md#save) or [`drop()`](../API/EntityClass.md#drop) functions:
115
-
- If **false**: `status` gets `dk status validation failed`and `statusText` gets "Mild Validation Error". Such errors do not require a [try catch](../Concepts/error-handling.md#trycatchend-try) and are not stacked in the errors returned by the [`Last errors`](../commands/last-errors.md) command.
116
-
- If **true**: `status` gets `dk status serious validation error` and `statusText` gets "Serious Validation Error". Such errors require a [try catch](../Concepts/error-handling.md#trycatchend-try)and are not stacked in the errors returned by the [`Last errors`](../commands/last-errors.md) command. They are raised at the end of the event and reach the client requesting the save/drop action (REST client for example).
117
-
- In case of an error triggered by a **saving/dropping** event, when an error object is returned, the error is always raised as a serious error (`dk status serious error`) whatever the `seriousError` property value.
105
+
| Propiedad | Tipo | Descripción | Set by the developer |
| errCode | Integer | Same as for [`Last errors`](../commands/last-errors.md) command | Sí |
108
+
| message | Text | Same as for [`Last errors`](../commands/last-errors.md) command | Sí |
109
+
| extraDescription | Object | Free information to set up | Sí |
110
+
| seriousError | Boolean | Used only with validate events (see below). <li>`True`: creates a [serious (unpredictable) error](../Concepts/error-handling.md#predictable-vs-unpredictable-errors) and triggers an exception. Adds the`dk status serious validation error` status</li><li>creates only a [silent (predictable) error](../Concepts/error-handling.md#predictable-vs-unpredictable-errors). Adds the `dk status validation failed` status</li> | Yes (default is false) |
111
+
| componentSignature | Text | Always "DBEV" | No |
112
+
113
+
-[Serious errors](../Concepts/error-handling.md#predictable-vs-unpredictable-errors) are stacked in the `errors` collection property of the **Result object** returned by the [`save()`](../API/EntityClass.md#save) or [`drop()`](../API/EntityClass.md#drop) functions.
114
+
- In case of an error triggered by a **validate** event, the `seriousError` property allows you to choose the level of the error to generate:
115
+
- If **true**: a serious error is thrown and should be handled by the [error processing code](../Concepts/error-handling.md#predictable-vs-unpredictable-errors), such as a [try catch](../Concepts/error-handling.md#trycatchend-try). In the result object of the calling function, `status` gets `dk status serious validation error` and `statusText` gets "Serious Validation Error". The error is raised at the end of the event and reach the client requesting the save/drop action (REST client for example).
116
+
- If **false** (default): a [silent (predictable) error is generated](../Concepts/error-handling.md#predictable-vs-unpredictable-errors). It does not trigger any exception and is not stacked in the errors returned by the [`Last errors`](../commands/last-errors.md) command. In the result object of the calling function, `status` gets `dk status validation failed` and `statusText` gets "Mild Validation Error".
117
+
- In case of an error triggered by a **saving/dropping** event, when an error object is returned, the error is always raised as a serious error whatever the `seriousError` property value.
0 commit comments