Skip to content

Further improve netkan relationship error message#4021

Merged
HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:fix/netkan-rel-msg-2
Feb 10, 2024
Merged

Further improve netkan relationship error message#4021
HebaruSan merged 1 commit into
KSP-CKAN:masterfrom
HebaruSan:fix/netkan-rel-msg-2

Conversation

@HebaruSan
Copy link
Copy Markdown
Member

Motivation

#4020 replaced the very unclear "Specified cast is not valid" message with a proper schema validation error. On further consideration, the schema error still isn't clear enough, because it doesn't explain why the array item is not valid.

1717 [1] FATAL CKAN.NetKAN.Program (null) - Schema validation failed: #/depends[0]: ArrayItemNotValid, #/depends[1]: ArrayItemNotValid, #/depends[2]: ArrayItemNotValid, #/supports[0]: ArrayItemNotValid, #/supports[1]: ArrayItemNotValid

Changes

Now the RelationshipsValidator explicitly checks the type of the elements of relationships arrays and prints a message that hopefully will be clearer:

$ netkan.exe NetKAN/kOS-KerbalEngineer.netkan
507 [1] FATAL CKAN.NetKAN.Program (null) - depends elements should be Object, found String: "KerbalEngineerRedux"

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix Netkan Issues affecting the netkan data Relationships Issues affecting depends, recommends, etc. labels Feb 10, 2024
@HebaruSan HebaruSan merged commit 05631a8 into KSP-CKAN:master Feb 10, 2024
@HebaruSan HebaruSan deleted the fix/netkan-rel-msg-2 branch February 10, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Easy This is easy to fix Enhancement New features or functionality Netkan Issues affecting the netkan data Relationships Issues affecting depends, recommends, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant