Commit Graph

12 Commits

Author SHA1 Message Date
ManicMarrc 5ea444b418 fix(error): point to the correct variant on the docs url 2023-10-17 04:54:15 +07:00
ManicMarrc 2450afce9e fix(error): use the positional way to format docs url 2023-10-17 04:49:17 +07:00
ManicMarrc 84f820477d feat: make `miette-derive` be optional 2023-10-17 03:46:52 +07:00
Moritz Mœller 5d23c0d61d
fix(docs): Docs overhaul (#124)
* Fixed/formatted all intradoc links. Various other small doc fixes/typography/etc.

* Clarified semantic similarity with anyhow/eyre types/macros.

* Removed unused MietteError::SetPrinterFailure.

* README now generaed from lib.rs via `cargo readme`.

* More doc fixes, made ErrorHook type public.

* Indentation (docs).
2022-02-25 08:39:18 -08:00
Kat Marchán 3f9da04b86
feat(report): anyhow-ify DiagnosticReport (#35)
This PR overhauls the toplevel/main experience for `miette`. It adds a new `Report` type based on `eyre::Report` and overhauls various types to fit into this model, as well as prepare for some [future changes in Rust](https://github.com/nrc/rfcs/pull/1) that will make it possible to integrate `miette` directly with crates like `eyre` instead of having to use this specific `Report`.

As such, this PR is a major breaking change, especially for anyone using `DiagnosticReport` and company.

BREAKING CHANGES:
* `DiagnosticReport` is now just `Report`, and is a different, `eyre::Report`-like type.
* `DiagnosticResult` is now just `Result`.
* `.into_diagnostic()` now just transforms the error into a `Report`.
* `DiagnosticReportPrinter` has been replaced with `ReportHandler`
* `set_printer` has been replaced by `set_hook`
* `code` is now optional.
* `.into_diagnostic()` no longer takes a `code` argument.
* `#[diagnostic]` is now optional when deriving `Diagnostic`.
2021-09-04 21:22:46 -07:00
Kat Marchán 2d886c06a3
docs: dogfood url(docsrs) 2021-08-22 15:59:27 -07:00
Kat Marchán eb4ea3423a
docs: add error code aliases
miette can't do this yet, but I can still do it by hand!
2021-08-22 00:22:38 -07:00
Kat Marchán e980b72373
feat(error): diagnostic-ify MietteError 2021-08-21 22:49:00 -07:00
Kat Marchán 29c1403efd
feat(reporter): Overhauled return type/main/DiagnosticReport experience.
Fixes: https://github.com/zkat/miette/issues/13
2021-08-17 23:41:03 -07:00
Kat Marchán b08e5cca62
format: cargo fmt 2021-08-10 19:21:31 -04:00
Kat Marchán 2fb9f93cbf
fix(api): stop re-exporting random things wtf??? 2021-08-04 20:28:19 -07:00
Kat Marchán 6b51694733
feat(protocol) overhauled entire protocol to be based on byte offsets (#1)
Includes other improvements!

BREAKING CHANGE: Yeah this is pretty much a rewrite.
2021-08-04 20:27:12 -07:00