Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom error example #194

Merged
merged 9 commits into from Jan 19, 2021
Merged

Commits on Jan 15, 2021

  1. Copy the full SHA
    af0f03f View commit details
    Browse the repository at this point in the history
  2. Attach validation-related errors to better span

    If the build() method cannot convert the validation error to the
    generated builder error, this is a problem with the validation function.
    The error span should point there, not at the macro call-site.
    
    Due to some issue in `darling` or `syn`, this change is pointing at the
    closing quotation instead of the whole path; that is being tracked as
    TedDriggs/darling#120.
    TedDriggs committed Jan 15, 2021
    Copy the full SHA
    4cd3f32 View commit details
    Browse the repository at this point in the history
  3. Format

    TedDriggs committed Jan 15, 2021
    Copy the full SHA
    be5011b View commit details
    Browse the repository at this point in the history
  4. Add UnitializedFieldError

    Structured errors need a safe way to act on uninitialized fields
    that doesn't conflate with validation errors. This commit adds that by
    providing a struct to represent an uninitialized field and generating
    conversions from that into the auto-generated error type.
    TedDriggs committed Jan 15, 2021
    Copy the full SHA
    30b6790 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2021

  1. Copy the full SHA
    0179d15 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    1d99146 View commit details
    Browse the repository at this point in the history
  3. Run rustfmt

    TedDriggs committed Jan 19, 2021
    Copy the full SHA
    afba6dc View commit details
    Browse the repository at this point in the history
  4. Add run-pass custom error test

    This test checks that we don't require unnecessary impls
    for custom errors when uninitialized fields are impossible.
    TedDriggs committed Jan 19, 2021
    Copy the full SHA
    b39d25e View commit details
    Browse the repository at this point in the history
  5. Test generic custom errors

    TedDriggs committed Jan 19, 2021
    Copy the full SHA
    91640ad View commit details
    Browse the repository at this point in the history