XPlane2Blender
XPlane2Blender copied to clipboard
Create error codes for error messages
As noted in #302, we need error codes to assert certain errors and line numbers have happened, not just X minimum amount.
In addition, it would be useful to have these to allow people to send in "ERROR 5220 happened!" as opposed to trying to awkwardly reword the error message, their interpretation of it, or potential translation of it. I'd rather be able to ask for a number, because sometimes it'd hard to reverse engineer an error string back to the source code.
"ERROR: whatever_mat doesn't have a proper specular whatever" could be duplicated across several places.
I would prefer
"ERROR 1267:xplane_material.py:86: whatever_mat doesn't have proper specual whatever" or something like that, where 86 is the line number.
There are several unit tests which require hand verification for some cases (such as drag_rotate_manip_type_mismatch.test) these will have to be updated in particular!
See also #146 (log deprecated warnings)
It would also be awesome if the API could add a source for the message (an XPlane type, a blender object, a string) and we can sort the logger by chronological order or by sections per thing to fix (perhaps an operator to re-write the log file using the different sorting methods?)
It would be also great figure our a real style guide like "Blender Objects are always in 'qoutes', X-Plane floats are always rounded with floatToStr, never use the passive voice" and make these a bit more unified.
The logger would save the collected messages as a data structure and we could make operators to sort them