apollo-errors 0.7.0

Structured error handling with automatic format conversion
Documentation
//! Tests for debug format output (to_debug)

mod common;

use apollo_errors::Error as ErrorTrait;
use common::{ErrorWithFields, SimpleError};
use insta::assert_snapshot;

#[test]
fn test_simple_error_debug() {
    let error = SimpleError::Simple;
    let debug = error.to_debug();
    assert_snapshot!(debug, @"Simple");
}

#[test]
fn test_error_with_fields_debug() {
    let error = ErrorWithFields::InvalidPort {
        port: 8080,
        config_file: "/etc/config.toml".to_string(),
    };
    let debug = error.to_debug();
    assert_snapshot!(debug, @r#"InvalidPort { port: 8080, config_file: "/etc/config.toml" }"#);
}