KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.98k stars 347 forks source link

MainClass.KerbalStuff fails when data does not contain ksp_version #361

Closed hakan42 closed 9 years ago

hakan42 commented 9 years ago

KerbalAlarmClock and KSPAlternateResourcePanel have no ksp_version configured on kerbalstuff. With following netkan file I get exceptions from netkan, no matter whether I put "ksp_version" in the file or not:

{
    "spec_version"   : 1,
    "identifier"     : "KerbalAlarmClock",
    "$kref"          : "#/ckan/kerbalstuff/231",
    "ksp_version"    : "0.25",
    "license"        : "MIT"
}
D:\work\ksp\NetKAN-hakan42>netkan.exe --version
KerbalStuff 1.0.5431.11443
pjf
D:\work\ksp\NetKAN-hakan42>netkan.exe --debug NetKAN\KerbalAlarmClock.netkan
...
187 [1] INFO CKAN.NetKAN.MainClass (null) - Processing NetKAN\KerbalAlarmClock.netkan
265 [1] DEBUG CKAN.NetKAN.KSAPI (null) - Calling https://kerbalstuff.com/api/mod/231

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> CKAN.BadKSPVersionException: Exception of type 'CKAN.BadKSPVersionException' was thrown.
   at CKAN.KSPVersion.Validate()
   --- End of inner exception stack trace ---
   ...   at CKAN.NetKAN.MainClass.KerbalStuff(JObject orig_metadata, String remote_id, NetFileCache cache)
   at CKAN.NetKAN.MainClass.Main(String[] args)
pjf commented 9 years ago

Same problems occurs with what we consider to be a malformed version (eg .23.5 rather than 0.23.5).

I suspect we'll need to pop in a custom JSON converter. If there's no KSP version, I guess we'll have to assume it's "any", unless our .netkan document overrides that.

Attn: @Felger, who's having the same issue.

pjf commented 9 years ago

Also attn @Ippo343, who's been packaging FASA at the same time. (I'm still catching up on PRs.)

Ippo343 commented 9 years ago

This issue was moved to KSP-CKAN/CKAN-netkan#7