docc2html icon indicating copy to clipboard operation
docc2html copied to clipboard

Error: dataCorrupted

Open IndigoCurnick opened this issue 1 year ago • 7 comments

Following on from #21 , DocCArchive was updated to 0.3.4. I made a pull request #22. It did fix the RoleHeading error, but that's lead onto several new errors around data corruption

ERROR: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "symbolKind", intValue: nil)], debugDescription: "Cannot initialize SymbolKind from invalid String value func", underlyingError: nil))

2023-10-16T08:58:44+0100 error docc2html : [DocCStaticExporter] Could not process document at: /Users/nathanielcurnick/Documents/NaurtSDK.doccarchive/data/documentation/naurtsdk/distancebetween(_:_:).json dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "symbolKind", intValue: nil)], debugDescription: "Cannot initialize SymbolKind from invalid String value func", underlyingError: nil))

ERROR: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

2023-10-16T08:58:44+0100 error docc2html : [DocCStaticExporter] Could not process document at: /Users/nathanielcurnick/Documents/NaurtSDK.doccarchive/data/documentation/naurtsdk/naurtsdkversionnumber.json dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

ERROR: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

2023-10-16T08:58:44+0100 error docc2html : [DocCStaticExporter] Could not process document at: /Users/nathanielcurnick/Documents/NaurtSDK.doccarchive/data/documentation/naurtsdk/naurtsdkversionstring.json dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

ERROR: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

2023-10-16T08:58:44+0100 error docc2html : [DocCStaticExporter] Could not process document at: /Users/nathanielcurnick/Documents/NaurtSDK.doccarchive/data/documentation/naurtsdk/poierrordomain.json dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identifier", intValue: nil), CodingKeys(stringValue: "interfaceLanguage", intValue: nil)], debugDescription: "Cannot initialize InterfaceLanguage from invalid String value occ", underlyingError: nil))

Unfortunately, these error messages mean a lot less to me now, let me know if you need any code snippets

IndigoCurnick avatar Oct 16 '23 08:10 IndigoCurnick

I think I figured out that docc2html doesn't play well with just public functions. Current workaround is to wrap public functions in a class. Still get a few of these errors, but fewer. Not sure what those errors pertain to, as the documentation generated seems fine

IndigoCurnick avatar Nov 14 '23 10:11 IndigoCurnick

I'm getting a similar problem:

ERROR: dataCorrupted occurred (Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "roleHeading", intValue: nil)], debugDescription: "Cannot initialize RoleHeading from invalid String value Global Variable", underlyingError: nil))

2023-11-15T11:04:13+0200 error docc2html: [DocCStaticExporter] Could not process document at: /Users//Desktop//.doccarchive/data/documentation///.json dataCorrupted (Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "roleHeading", intValue: nil)], debugDescription: "Cannot initialize RoleHeading from invalid String value Global Variable", underlyingError: nil))

ERROR: dataCorrupted occurred (Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "roleHeading", intValue: nil)], debugDescription: "Cannot initialize RoleHeading from invalid String value Global Variable", underlyingError: nil))

2023-11-15T11:04:13+0200 error docc2html: [DocCStaticExporter] Could not process document at: /Users//Desktop//.doccarchive/data/documentation///.json dataCorrupted (Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "metadata", intValue: nil), MetaDataCodingKeys(stringValue: "roleHeading", intValue: nil)], debugDescription: "Cannot initialize RoleHeading from invalid String value Global Variable", underlyingError: nil))

richardtop avatar Nov 15 '23 09:11 richardtop

Those things are easy to fix, just need to get to it, sorry :-)

What is helpful are full examples I can debug against. I.e. a demo project I can run the things against.

helje5 avatar Nov 16 '23 13:11 helje5

Thanks, unfortunately, I cannot provide the docc archive I'm using to test this package.

richardtop avatar Nov 16 '23 14:11 richardtop

Maybe you can recreate the issue in an essentially empty package w/ placeholder types.

(but I can also add the fields blind)

helje5 avatar Nov 16 '23 14:11 helje5

I'm running this not on an empty package but with doccarchive

richardtop avatar Nov 17 '23 09:11 richardtop

Hi @helje5, sorry for taking a little to get back to you, I have intermittent access to a Mac to build the docarchive

Sure, here's access to the docarchives I'm working with.

This one is the original version, which has several dataCorrupted errors, and a section of the archive fails to be generated as HTML - the distanceBetween function specifically. Here

This one is my workaround. I wrap the distanceBetween in a new class Karney. As far as I can see, it builds fine but still generates some errors. Not sure what the consequence of them is though. Here

IndigoCurnick avatar Nov 17 '23 13:11 IndigoCurnick