Alex Orlenko
27f91dfd1b
Accept any error in Function::wrap/wrap_mut/wrap_async
...
Previously wrapped functions were required to return `mlua::Result`.
Now it's possible to wrap functions returning any errors as long as
they implement `std::error::Error`.
Existing code remains compatible with `mlua::Result` as this type
is not converted to an external error.
2026-04-18 16:01:35 +01:00
Alex Orlenko
084a85c3d8
Update error tests
2024-10-16 23:57:48 +01:00
Alex Orlenko
4bc846a119
Add optional anyhow dependency (under the same feature flag) to implement IntoLua for anyhow::Error
2024-10-05 23:16:36 +01:00
Alex Orlenko
b65901e444
Add Error::chain method to return iterator over nested errors
2024-09-24 22:48:19 +01:00
Alex Orlenko
3641c98959
Prepare for Rust 2024 edition (see rust-lang/rust#123748 )
...
Replace `IntoLua(Multi)` generic with positional arg (impl trait) where possible
This allow to shorten syntax from `a.get::<_, T>` to `a.get::<T>`
2024-07-31 23:42:43 +01:00
Alex Orlenko
b4892c228c
Add rustfmt.toml
2024-07-31 13:42:37 +01:00
Alex Orlenko
6488477bc4
rustfmt 1.72+
2023-08-27 23:26:27 +01:00
Alex Orlenko
7dc6e4c132
Add Error::runtime() helper
2023-07-10 22:41:03 +01:00
Alex Orlenko
1ac98e7d16
- Allow downcasting error wrapped into Error::WithContext
...
- Overwrite error context when called multiple times
2023-05-08 23:39:53 +01:00
Alex Orlenko
4bc6501d2e
Tests for the ErrorContext trait
2023-03-17 01:31:07 +00:00