How to "catch" export errors

1701
2
01-08-2012 07:28 AM
AndréCardoso
New Contributor III
While having a export process automatized by a python script, it becomes necessary to deal with export errors.

I'm getting errors like these:
"The batch export is complete. For at least one shape a generation error occurred. Please refer to the .log file at the export location and check the corresponding shape settings. - [main]"

Is there any way to check if an error has occurred while exporting a shape's model? for example in the "finishModel" function?

Thanks!
André
Tags (3)
0 Kudos
2 Replies
MatthiasBuehler1
Frequent Contributor
Hi ..


Here's the answer of Simon, one of the developers.

* * *

unfortunately, there is currently no way to access the export status for a shape directly via a python call. i suggest the (admittedly inelegant) method to parse the export log file in the finishExport() or after the
ce.export() call and cross-reference it with the collected shape uuids from the finishModel() call:

...

def finishModel(exportContextUUID, shapeUUID, modelUUID):
print "finishModel: shape uuid = ", shapeUUID
# TODO: put shapeUUID into a list here...

...

# Called after all shapes are generated.
def finishExport(exportContextUUID):
...
ce.export(...)
# TODO: parse the "INPUT REPORT" section of the export log and
# compare with the shape uuids collected above,
   # check for the "ERROR" string

i have put your request into our ticket database. the plan is to extend
the ce.export() call with a datastructure which will contain the export
status for each input shape.

sorry for the mixed news & kind regards,
simon
0 Kudos
AndréCardoso
New Contributor III
Hi ..


Here's the answer of Simon, one of the developers.

* * *

unfortunately, there is currently no way to access the export status for a shape directly via a python call. i suggest the (admittedly inelegant) method to parse the export log file in the finishExport() or after the
ce.export() call and cross-reference it with the collected shape uuids from the finishModel() call:

...

def finishModel(exportContextUUID, shapeUUID, modelUUID):
print "finishModel: shape uuid = ", shapeUUID
# TODO: put shapeUUID into a list here...

...

# Called after all shapes are generated.
def finishExport(exportContextUUID):
...
ce.export(...)
# TODO: parse the "INPUT REPORT" section of the export log and
# compare with the shape uuids collected above,
   # check for the "ERROR" string

i have put your request into our ticket database. the plan is to extend
the ce.export() call with a datastructure which will contain the export
status for each input shape.

sorry for the mixed news & kind regards,
simon


Ok!

That feature would be nice to have!!
There are times when early-catching errors is very important. For example, I'm populating a SQLite database while exporting models. Having those errors caught while exporting would save me plenty of work (opposed to cross referencing the UUIDS from the log, and then redo whatever work I need to based on that information)

In fact, that data structure that you talk should probably contain other data types of data as well: comes to mind the actual written filename (or filenames)  for the exported shape. Something simple but I think it saves some work (totally possible to "predict" the filename right now though, but it would be nice to have that on the API :)... this was from top of my mind... but there are probably more important details to include on that datastructure.


Thanks!
André
0 Kudos