eclipse-ankaios / ankaios

Eclipse Ankaios provides workload and container orchestration for automotive High Performance Computing (HPC) software.
https://eclipse-ankaios.github.io/ankaios/
Apache License 2.0
59 stars 18 forks source link

Adding a library for automatic error type conversions #178

Open inf17101 opened 6 months ago

inf17101 commented 6 months ago

Description

Currently, we write error conversion code manually, e.g. try_from/from. This was fine when having a small code base and to have full control over the view try_froms/froms.

However, it is common Rust practice to use error conversion libs that do the code generation automatically. Especially for larger and growing code bases it simplifies error conversion.

Typical error libs:

However there are a view other libs that can be considered and discussed, but anyhow and thiserror is publicly known.

A simple result type with auto conversions are also better for readability.

Goals

Simplifying and automating error code conversion.

Final result

Summary

To be filled when the final solution is sketched.

Tasks

inf17101 commented 6 months ago

Also interesting: https://www.lpalmieri.com/posts/error-handling-rust/#anyhow-or-thiserror