Skip to content

Include package or license code into JsonDeserialization exception#77

Merged
max-ieremenko merged 1 commit intorelease/3.4.1from
feature/library-license-deserialize
Sep 16, 2023
Merged

Include package or license code into JsonDeserialization exception#77
max-ieremenko merged 1 commit intorelease/3.4.1from
feature/library-license-deserialize

Conversation

@max-ieremenko
Copy link
Owner

For some reason, the index.json file of the license or package may be corrupted, e.g. during manual editing.
In this case, an exception will be thrown, like in #76:

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'ThirdPartyLibraries.Repository.Template.LibraryIndexJson' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.

To make it easier to investigate which file is corrupted, the exception should include the full package name or license code:

Failed to deserialize contents of index.json of package npmjs.com/bootstrap/4.6.1. System.InvalidOperationException: Failed to deserialize contents of index.json of package npmjs.com/bootstrap/4.6.1. ---> Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'ThirdPartyLibraries.Repository.Template.LibraryIndexJson' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.

@max-ieremenko max-ieremenko merged commit f0cce41 into release/3.4.1 Sep 16, 2023
@max-ieremenko max-ieremenko deleted the feature/library-license-deserialize branch September 16, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant