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

Rework errors #675

Merged
merged 24 commits into from
Nov 3, 2023
Merged

Rework errors #675

merged 24 commits into from
Nov 3, 2023

Commits on Oct 28, 2023

  1. Configuration menu
    Copy the full SHA
    e0adb66 View commit details
    Browse the repository at this point in the history
  2. cargo fmt

    Strange, that cargo_fmt did reformat the code that previously
    was acceptable and didn't changed in the previous commit
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    da2823d View commit details
    Browse the repository at this point in the history
  3. Remove DeError::UnexpectedEnd, because this error could be returned…

    … only if the deserializer has a bug
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    d9520c4 View commit details
    Browse the repository at this point in the history
  4. Remove DeError::ExpectedStart, call Visitor::visit_borrowed_str o…

    …r `visit_string` instead
    
    It is responsibility of a `Visitor` to return an error if the provided data can not be handled
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    77e5a2c View commit details
    Browse the repository at this point in the history
  5. Do not return DeError::Unsupported in SimpleTypeDeserializer, cal…

    …l `deserialize_str` instead
    
    Deserializer methods are only hints, if deserializer could not satisfy
    request, it should return the data that it has. It is responsibility
    of a Visitor to return an error if it does not understand the data
    
    UnitDeserializer::new() available only since serde 1.0.139 (serde-rs/serde#2246)
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    a5490f2 View commit details
    Browse the repository at this point in the history
  6. Do not return DeError::Unsupported in attempt to deserialize byte data

    Provide to visitor a string or a map instead.
    
    Deserializer methods are only hints, if deserializer could not satisfy
    request, it should return the data that it has. It is responsibility
    of a Visitor to return an error if it does not understand the data
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    f845369 View commit details
    Browse the repository at this point in the history
  7. Do not return DeError::Unsupported in attempt to deserialize newtyp…

    …e, tuple or struct from QName
    
    Provide to visitor a unit instead.
    
    Deserializer methods are only hints, if deserializer could not satisfy
    request, it should return the data that it has. It is responsibility
    of a Visitor to return an error if it does not understand the data
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    77a2fad View commit details
    Browse the repository at this point in the history
  8. Replace Error::UnexpectedEof and Error::UnexpectedBang by `Error:…

    …:Syntax(SyntaxError)`
    Mingun committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    29ca886 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2023

  1. Replace Error::UnexpectedEof by Error::IllFormed(MissedEnd) in re…

    …sults of `read_to_end`
    
    Co-authored-by: Daniel Alley <dalley@redhat.com>
    Mingun and dralley committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    0e5188d View commit details
    Browse the repository at this point in the history
  2. Do not convert DeError::InvalidXml(Error::IllFormed(MissedEnd)) to …

    …`DeError::UnexpectedEof`
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    f7ee91f View commit details
    Browse the repository at this point in the history
  3. Replace DeError::UnexpectedEof by Error::IllFormed(MissedEnd) whe…

    …n read text in a tag and cover that case by test
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    a91843e View commit details
    Browse the repository at this point in the history
  4. Replace DeError::UnexpectedEof by Error::IllFormed(MissedEnd) in …

    …cases where Eof was received while waiting end tag
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    7d20324 View commit details
    Browse the repository at this point in the history
  5. Replace DeError::UnexpectedEof by Error::IllFormed(MissedEnd) and…

    … cover case for a field of a sequential type
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    4972d4f View commit details
    Browse the repository at this point in the history
  6. DeEvent::Eof is impossible in MapValueDeserializer::variant_seed,…

    … explicitly show this using `unreachable!`
    
    when we in that branch, `Start` or `Text` event already was picked
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    cee2725 View commit details
    Browse the repository at this point in the history
  7. Remove unnecessary allocation

    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    d5489df View commit details
    Browse the repository at this point in the history
  8. Report trimmed found name in EndEventMismatch error when end tag has …

    …no corresponding open tag
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    00de446 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ff28390 View commit details
    Browse the repository at this point in the history
  10. Inline mismatch_err closure because in the next commit it will genera…

    …te 2 different errors
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    73fcf23 View commit details
    Browse the repository at this point in the history
  11. Replace Error::EndEventMismatch by Error::IllFormed(UnmatchedEnd)

    … in cases where start tag is missing
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    6670800 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4d887a2 View commit details
    Browse the repository at this point in the history
  13. IllFormed(UnmatchedEnd) should be reported always because lone clos…

    …ed tags are not allowed even in HTML
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    a4febad View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    596edd6 View commit details
    Browse the repository at this point in the history
  15. Remove not used Error::TextNotFound

    The only usage was removed in 792d23d in tafia#445
    Mingun committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    53c6b4e View commit details
    Browse the repository at this point in the history
  16. Better document Error::XmlDeclWithoutVersion and Error::EmptyDocType

    Co-authored-by: Daniel Alley <dalley@redhat.com>
    Mingun and dralley committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    a049cd2 View commit details
    Browse the repository at this point in the history