-
Notifications
You must be signed in to change notification settings - Fork 14
CactEye 2 Error Codes
The CactEye 2 mod's code base was redesigned in such a way to make it easier for any plugin developer to troubleshoot problems, should CactEye ever experience a problem or become incompatible with future versions of KSP. It does this by being rather verbose in the log files, and this document details the CactEye error codes and what they mean.
There are two basic types of errors that CactEye will throw: Exceptions and Errors.
Exceptions, such as a NullReferenceExceptions, happens when KSP/CactEye have nothing tangible to do with an error situation, and the system call stack begins to "unwind." These are common when CactEye runs on an incompatible version of KSP, in which Squad has made changes to the KSP API.
Errors are conditions which CactEye is design to specifically look for and attempt to correct.
All Exceptions and Errors will be written to the KSP.log file when detected. CactEye will always identify it's log entries with the prefix "CactEye 2:"
"Was not able to create the Telescope Control Menu object. You should try re-installing CactEye2 and ensure that old versions of CactEye are deleted."
This is due to an error in bringing up the CactEye menu when right clicking on the CactEye Optics module. This exception can be thrown for several reasons.
-
CactEye is running on an incompatible version of KSP, such as a future release in which Squad has made changes to the KSP API.
-
CactEye was not properly upgraded. When upgrading to a new version, the CactEye folder should be deleted.
"Was not able to create the camera object."
This is an exception that should never be seen. If this is seen, then there is a very serious problem with the CactEye code base, and CactEye would be in need of an update. It is possible to see this on an incompatible version of KSP, such as a future release, but this is unlikely.
It is much more likely that if this exception is seen, then it's because changes were made to the CactEye camera object in the code, and proper testing was not performed to verify the functionality of the code.
"Was not able to get a list of Reaction Wheels or Processors."
When a player brings up the CactEye GUI, CactEye will search for any available gyroscopes and processors on the currently active craft. If something goes wrong while searching for those two types of parts, this exception will be thrown. Possible reasons are because:
-
Incompatible version of KSP, such as a future release. Particularly if Squad has made any changes to the Reaction Wheel code.
-
A regression bug; a bug caused by an update to the code and failure to properly test the changes.
"An error occurred producing a science report!"
This is a rather generic exception, and covers a whole range of problems. This exception is thrown when a player attempts to generate a science report with the science icon in the GUI. This exception will never be seen in sandbox mode; only career mode players will see this. Possible causes are:
-
Incompatible version of KSP, specifically a version where changes were made to the Science system.
-
This could be thrown when CactEye is also loaded with another mod that makes changes to KSP's celestial bodies. If this is the case, the problem is not with CactEye, but rather the problem is caused by the mod that made the celestial body changes.
-
Tampering or corruption with the GameData/CactEye/Resources/ScienceRefs.cfg file.
"Was not able to find Experiment with ExperimentID: "
This is a very specific exception. This exception indicates tampering or corruption of the GameData/CactEye/Resources/ScienceRefs.cfg file. This is caused by:
-
Tampering of the config file by a player.
-
A careless mistake made by a developer of CactEye, specifically with a CactEye update that adds a new processor type.
"Was not able to find the next processor, even though there is one. "
Like most exceptions, this is an error that should never occur under normal operating conditions. Typically, if this exception is seen in a log file, then it means that a new processor type was implemented poorly in a feature update to CactEye, or, the CactEye installation files have become corrupted. In either case, it pays to completely delete KSP and all mods, and then reinstall KSP, CactEye, and then all of your favorite mods.
"The Camera Object is null. The mod author needs to perform a code review."
Exactly as the error message describes, if this error is seen in a log file then it means a developer needs to review and debug the code base. The camera object the message is referring to is a C# list of camera objects. If list is null, then it means that CactEye will not be able to produce an image in the CactEye GUI. Other exceptions and errors may be seen in the log file at different intervals, due to a null reference.
"CameraBody.AddComponent returned null! If you do not have Visual Enhancements installed, then this error can be safely ignored."
This is thrown when a specific function within the CactEye camera code returns null. This is usually because the player does not have the Visual Enhancements mod installed, in which case the error can be ignored safely.
A lot of the code related to this error are specific to the Unity game engine, and not the KSP API.
"SkinStored is null!"
If this error is ever seen, a likely symptom that will be seen with it is that when performing a science experiment unrelated to CactEye, the science dialogue will appear identical to that of the last CactEye experiment performed.
This is because CactEye stores change made to the science dialogue when performing a CactEye experiment for purpose of reverting it back to normal. If CactEye is unable to save the changes, then this error will be performed. A developer is needed to perform an update to the CactEye in order for this error to be resolved.