Skip to content

Commit

Permalink
85 decrire gestion error dans la platform (#86)
Browse files Browse the repository at this point in the history
* update

* update
  • Loading branch information
XdoctorwhoZ authored Jun 10, 2024
1 parent c649f39 commit b42c069
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions content/docs/50_platform/architecture/error_management/index.md
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.

0 comments on commit b42c069

Please sign in to comment.