Illustrator error code 271?
I realise this is a long shot because I've literally ran the entirety of the Illustrator 2023 SDK through string searches at this point without any luck, but does anyone happen to know what the Illustrator error code 271 means?
For context, I'm working on optimising an automated process that uses Adobe Illustrator CC to process maps exported from GIS in order to make them more presentable - changing simple placeholder symbols for more detailed ones, changing text fonts, placing landmark icons, the works. One of the (over a hundred!) steps of this process involves copying page decorations from a template Illustrator file depending on the intended size of the final print, and... sometimes, this step fails. Not always, not necessarily even often, but every now and then the process fails and it is almost always this step that's the cause.
I've even tracked down where it happens - specifically on the line where it attempts to open the template file. In the prior C# .NET implementation, using Microsoft COM object calls to communicate with Illustrator, the specific call looked like this:
aiApplication.Open(TemplatePath, null, null);While in the faster, Illustrator Plugin-based version of the call looks like this:
error = sAIDocumentList->OpenNoHistory(source_doc_file, kAIUnknownColorModel, kDialogNone, false, &source_doc_ref);Both of these are subject to the problem - most of the time it works just fine, the file opens, things are copied over, puppies and butterflies manifest in the world. But every now and then, maybe every 10th to 20th run or so, the file will fail to open, giving error 271. And as a full run through the process can sometimes take up to an hour or more on particularly heavy documents, a failed run can be something of a problem.
Like said, I've tried trawling through both the SDK documentation and the SDK source files themselves but to no avail - in fact, as far as Illustrator SDK error codes go, it's a rather peculiar one: the vast majority of Illustrator error codes are effectively a char[4] array essentially - for example you have the infamous kBadParameterErr, or 'PARM', which translates to error code 1297236304 when read as an integer value. 271 does not translate into a 4-character string - at most it translates into two ascii control characters, 15 (shift in) and 1 (start of header), which to me makes it sound like a lower level error than those the Illustrator SDK API expects to encounter - which unfoirtunately also makes it all the less likely to find any actual reference for what exactly it means.
I'm currently testing a way of working around the error by having the plugin a handful of attempts to re-try opening the file if it fails before determining the entire step a failure, but I'd also just love to know what the actual problem is - what does error code 271 mean, and more importantly, why is it happening? And why only every now and then? And is there anything that can be done preventively to avoid getting it in the first place?
Anyway, like I said at the start, this is very much a long shot - I've found nothing that mentions an error code 271 in either the SDK documentation, example projects, or source headers and cpp files, and googling the error has returned precious little. It's basically on the off-chance that someone here has encountered the error beforehand and knows more about it, or someone more intimately familiar with how Illustrator works under the hood who just happens to know where it comes from, but I figured I'd at least ask.
