Sunday, July 20, 2014

FMod - Better Error

"Error creating dependency file", or after the v1.5 unified opening and creating dependency files, "Error processing dependency file" is the most common Abiathar error message. It's also the most useless thing ever, it tells you nothing about what went wrong and what you might do to fix it. Simple things like referencing non-existing files are caught in the New Project Wizard, but there is still a lot than can go wrong (e.g. switching some files around) that I don't want to write a lot of complicated checks for.

So, today, I did something better. Somebody on Keen:Modding suggested that Abiathar generate an error report that could be sent to me when something bad happens. This is already done when the entire program crashes, but it would likely be far more helpful here, since I have never actually seen the program crash, nor has anybody reported it. I added a lot of things to that exception handler to gather details about the environment and write it to an error file if the user so chooses. The report consists of the following sections:
  • Stage of dependency file opening at which the exception was thrown
  • Name, size, and MD5 of all files in the working directory
  • Exception message, source, and stack trace (and those of the inner exception if applicable)
  • Metadata of all extensions installed
  • Serialization of the core entry in the dependency file
The stage information is gathered by setting an informational string value before entering a new section of the loader, which obviously stops updating if an exception happens. The MD5 calculation is skipped if the file is already open (or if it is Abiathar).

This scheme generates very nice crash reports, which should help me figure out the problem when people receive inexplicable errors.

No comments:

Post a Comment