Uploaded image for project: 'MediaPortal 2'
  1. MediaPortal 2
  2. MP2-403

Handle deserialization errors more gracefully in OnlineLibraries

    XMLWordPrintable

Details

    • Icon: Improvement/Rework Improvement/Rework
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.0.0-alpha.3
    • Metadata Extractors

    Description

      <p>Currently, when a MetadataExtractor uses OnlineLibraries, which uses NewtonSoft.Json to download data from an online source, and there is an error when deserializing a single value in the downloaded Json object, an exception is thrown and no values at all are deserialized and imported.</p><p>It would be better to use a JsonSerializerSettings object with an error handler delegate, log the specific deserialization error only for that specific value, set errorcontext.handled=true and let newtonsoft.json deserialize the rest of the object.</p><p>That way we aviod the exception and deserialize and import all the correct values in the downloaded Json-object. Only the one that causes the error is omitted.</p>

      Attachments

        Activity

          People

            Unassigned Unassigned
            MJGraf MJGraf (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: