Commit graph

5 commits

Author SHA1 Message Date
Cain
961f57d6ec chore(msrv): bump to 1.71.1 2024-11-26 13:50:01 +00:00
CosminPerRam
3c9f109942 chore: reformat markdown files 2024-04-14 23:08:11 +03:00
Tom
5e7e010d24
[Crate] Add rich error type (#80)
* Add rich error type with source and backtrace

Adds a rich error type that will take a backtrace and allow capturing
the source of the error. The best way to use this is with the included
helpers that will automatically capture the backtrace and convert the
source error:

```
GDRichError::packet_bad_from_into("Reason packet was bad")
```

* [Crate] Bump MSRV to 1.65.0

This is required for backtraces in rich errors.

* Remove leftover debug logging

* [Errors] Replace variant overloads with single .rich method on kind enum

This overhaul replaces the exhaustive impls of each variant as multiple
methods on the rich error type with a singular .rich() method on the
kind enum. This consumes the variant and converts it to a rich error
with a source (.into() can be used if a source is not needed).

I also took the liberty of replacing all usages with the this new method
as I saw fit (adding various error messages) and converting a few
PacketBad errors to TypeParse errors when they are the result of parse
failing.

* Fix problem with rustdoc

* Remove BadGame's owned string

* Rename GDError to GDErrorKind

* Rename GDRichError to GDError

* Remove error impl from GDErrorKind

* Fix tests not passing

* Use error context everywhere map_err is used

* Improve GDError display formatter

* Add tests for new error type
2023-08-05 12:36:48 +03:00
Tom
fb9d15f0cc
[Crate] Bump rustfmt version to 1.6.0 (#69) 2023-07-10 18:32:17 +03:00
Tom
bf14ecb4a4
[Crate] Add documentation for where versions need to be updated (#58)
VERSIONS.md tells you what the current versions for things like MSRV is
and which files you need to update if you change it.

Also fixes the incorrect:
- MSRV in README.md
- nightly version in .pre-commit-config.yaml
2023-06-25 16:02:25 +03:00