-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
85 decrire gestion error dans la platform (#86)
* update * update
- Loading branch information
1 parent
c649f39
commit b42c069
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
content/docs/50_platform/architecture/error_management/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: "platform_error" | ||
description: "" | ||
weight: 1 | ||
icon: "error" | ||
--- | ||
|
||
Here are the rules for the error management inside the platform | ||
|
||
The file `src\platform\error.rs` provides the Error class for the platform. This error stores the file and the line of the error. | ||
|
||
Platform provides 2 macros to help declaring platform errors. | ||
|
||
```rust | ||
// return a platform error object | ||
use crate::platform_error; | ||
// return a platform error object inside an Err result | ||
use crate::platform_error_result; | ||
``` | ||
|
||
Two other result types are defined for common cases | ||
|
||
```rust | ||
// For async task end result | ||
use crate::platform::TaskResult; | ||
// For generic task functions that just return OK on success | ||
use crate::platform::FunctionResult; | ||
``` | ||
|
||
Each function of the platform must return at some point an Error platform. | ||
This allow platform top functions to manage the proper error management and display. |