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

Catch invalid $kref in Netkan #2516

Merged
merged 1 commit into from
Oct 7, 2018

Conversation

HebaruSan
Copy link
Member

Problem

Currently if you have an invalid $kref:

    "$kref"        : "#/ckan/techman/iscool",

The error message isn't super clear:

$ ../CKAN/_build/netkan.exe NetKAN/KSP-AVC.netkan 
343 [1] ERROR CKAN.CkanModule (null) - KSP-AVC missing required field download
354 [1] FATAL CKAN.NetKAN.Program (null) - KSP-AVC missing required field download

Here it's telling us that it doesn't have a download property, which is indeed caused by the $kref being invalid, but it's rather indirect and not necessarily clear to a new user.

Changes

Now the NetkanValidator has a new validation step that checks whether metadata.Kref.Source is a known valid value (null is also OK). If not, it prints a new error message:

$ ../CKAN/_build/netkan.exe NetKAN/KSP-AVC.netkan 
288 [1] FATAL CKAN.NetKAN.Program (null) - Invalid $kref: #/ckan/techman/iscool

RemoteRef.ToString previously dropped the /ckan/ portion of the original string; #/ckan/techman/iscool became #/techman/iscool. To reduce confusion, this function now preserves the original string.

Fixes #374.

@HebaruSan HebaruSan added Pull request Netkan Issues affecting the netkan data labels Aug 26, 2018
@HebaruSan HebaruSan mentioned this pull request Aug 26, 2018
@politas politas merged commit bb57c84 into KSP-CKAN:master Oct 7, 2018
politas added a commit that referenced this pull request Oct 7, 2018
@HebaruSan HebaruSan deleted the feature/catch-invalid-kref branch October 7, 2018 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Netkan Issues affecting the netkan data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants