Skip to content

Releases: knox-networks/bigerror

v0.9.0

15 Oct 20:00
d5bffbf
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.2...v0.9.0

v0.8.2

12 Sep 20:36
fd7ee3d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.8.1...v0.8.2

v0.8.1

01 Apr 18:19
75c6426
Compare
Choose a tag to compare

Changelog

[0.8.1] - 2024-04-01

upgrade tonic to 0.11

v0.8.0

01 Apr 16:29
4c1b65e
Compare
Choose a tag to compare

Changelog

[0.8.0] - 2024-04-01

Add grpc feature with traits #10

This copies over the ReportStatus and ResultReportStatus traits from Knox core and places them into a new grpc package that is toggled by a grpc feature flag.

v0.7.0

27 Mar 18:52
7e25fac
Compare
Choose a tag to compare

Changelog

[0.7.0] - 2024-03-27

  • Added context::Timeout
  • Added attachment::DisplayDuration
  • Added Reportable::with_type_status
  • Added ClearResult trait for mapping Ok(T) -> Ok(()) and Err(E) -> Err(()) types respectively

Add expect_field! macro #6

Added expect_field! macro:
https://github.com/knox-networks/bigerror/blob/93b087f0ee8447b55ceb67efd980711d0c6cfba6/src/lib.rs#L982-L988
the above expect_field! invocation desugars into:

// ...
let my_field = bigerror::OptionReport::ok_or_not_found_field(my_struct.my_field, "my_field")?;
// ...

  • added FrError
  • added SetupError
  • added just printerr <test::uri> to show the error trace of a given unit test
  • refactored bigerror::__field macro to handle optional methods: my_struct.my_field.as_ref()

Rename OptionReport methods #7

Breaking change that renames OptionReport methods:

 pub trait OptionReport {
     type Some;
-    fn ok_or_not_found(self) -> Result<Self::Some, Report<NotFound>>;
-    fn ok_or_not_found_kv<K, V>(self, key: K, value: V) -> Result<Self::Some, Report<NotFound>>
+    fn expect_or(self) -> Result<Self::Some, Report<NotFound>>;
+    fn expect_kv<K, V>(self, key: K, value: V) -> Result<Self::Some, Report<NotFound>>
     where
         K: Display,
         V: Display;
-    fn ok_or_not_found_field(self, field: &'static str) -> Result<Self::Some, Report<NotFound>>;
-    fn ok_or_not_found_by<K: Display>(self, key: K) -> Result<Self::Some, Report<NotFound>>;
+    fn expect_field(self, field: &'static str) -> Result<Self::Some, Report<NotFound>>;
+    fn expect_by<K: Display>(self, key: K) -> Result<Self::Some, Report<NotFound>>;
 }
  • OptionReport::expect_or was used to avoid namespace conflicts with Option::expect
  • This should align it with expect_* macros such as bigerror::expect_field!(my_struct.my_field)?;

Introduce typed key/value attachments #8


Add accessor method handling for expect_field!, ResultIntoContext trait additions #9

ResultIntoContext trait:


expect_field! macro:


Added new contexts:

  • EncodeError
  • DecodeError
  • AuthError
  • InvalidState

  • Added attachment::FromTo
  • Added Reportable::attach_variant
  • Added LogError::on_err

v0.6.0

04 Jan 18:02
33b0553
Compare
Choose a tag to compare

Changelog

[0.6.0] - 2024-01-04

  • InvalidInput::expected_actual is now a blanket method: Reportable::expected_actual
  • added Reportable::with_variant
  • added Reportable::with_variant_debug
  • added OptionReport::ok_or_not_found_by
  • added Reportable::with_type
  • added attachment::Index for referencing vec indices and map/db keys
  • OptionReport::ok_or_not_found_by now uses attachment::Index for
    the key
  • added runnable example test case to README documentation
    cargo test -- session::test::multi_associated --nocapture

v0.5.0

16 Oct 17:49
ac96aad
Compare
Choose a tag to compare

Changelog

[0.5.0] - 2023-10-16

  • Removed into_report

  • Upgraded to handle error-stack 0.4

  • Updated minor version

v0.4.0

09 Oct 15:48
1bea48c
Compare
Choose a tag to compare

Changelog

[0.4.0] - 2023-10-04

  • Introduced OptionReport trait#1

  • Intorduced IntoContext and ReportIntoContext traits #2

  • Split src/kind.rs into src/context.rs and src/attachment.rs

  • Removed foreign closure calls that prevented #[track_caller]

  • Added impl<C> ToReport<C> for Report<C>

  • Added attachment::Unsupported

  • Added attachment::Field

  • Added Reportable::with_field_status

  • ReportAs now implemented for &str and String

  • Attachment keys are now generic

  • Added BoxCoreError to satisfy core::error::Error trait

  • impl<T, E: Context> ReportAs<T> for Result<T, E> now uses Report::attach_printable

v0.3.0

30 May 15:21
724313f
Compare
Choose a tag to compare

Changelog

[0.3.0] - 2023-05-30

  • Create rust.yml for CI

  • Added unit tests

  • Added cliff.toml

  • Added bigerror::init_colour() and bigerror::init_emphasis

  • Updated with no ansi

  • Redundant comment removed

  • Removed constraint

  • Added ToErrReport trait

  • Added BoxError type to handle Box<dyn std::error::Error>

  • README.md example now compiles

v0.2.0

26 May 20:37
59d81da
Compare
Choose a tag to compare

Changelog

[0.2.0] - 2023-05-26

  • Added BuildError
  • Added InvalidInput::expected_actual
  • Added InvalidInput::type_name
  • Added LogError::and_log
  • Added ReportAs trait
  • Added Reportable::report_inner
  • Added Reportable::report_with_kv
  • Added Reportable::with_kv_debug
  • Added ReportableExt
  • Added cargo license
  • Fixed missing field display
  • Made MissingField an attachment for NotFound::with_field (was previously an extra Frame)
  • Reexport error_stack
  • ConversionError now takes generics