Add an option for custom Exception Handling on a global level (+improved popups)

Issue #30 new
ogerboss created an issue

Yesterday I was working on improving some of pop-ups in Requiem's patcher. To be precise I rewrote then such that they can be HTML-formatted and contain active hyperlinks to point users directly to the relevant article in my Confluence Wiki when they encounter problems. Furthermore I also added tooltips for these hyperlinks, to show the web-address of the link when the mouse hovers over them. (And users can copy the text from the popup messages, thus pasting them easily.)

At the moment I wrapped this functionality into a try-catch clause within the runChangesToPatch() function. This however means that

  • I need extra blocks in the OnStart() and OnExit() blocks to handle exceptions raised there
  • I have no means to directly customize any other error messages other than wrapping another try-catch into the main() function (I do this to tell users directly to upload their debug logs to pastebin before asking for help)

Would there be interest for adding some kind of "Exception Manager", which can be declared just like the custom GUI and takes over all exception handling from SkyProc, if defined by the modder? I would be willing to embed my implementation directly into SkyProc, together with an infrastructure for popups with the features listed above.

Comments (3)

  1. Daria Tynan repo owner

    That's an interesting idea. I think it'd be a fine addition to SkyProc but its not something I'm not experienced with in a generic way. I'm not sure I'd be willing to take the lead on it but if you want to take a shot at it I'll add it to the library when its done. If you want to message me on steam or gmail or something I'll help sketch out a plan before you dive into coding since I'm pretty familiar with the guts of skyproc.

  2. ogerboss reporter

    The integration into SkyProc itself should be rather simple (I hope).

    At the beginning, SkyProc should ask, if the patcher has a custom exception manager. Then the Start, Import, RunChanges, Export and Stop stages will be wrapped into try-catch clauses that will either

    • handle the exception as it is done now, if the patcher has no manager
    • forward the exception to the specified manager (which must be a subclass of a new abstract class I will define)

    The manager should then execute the necessary steps to clean up the mess, display some customized error message and then exit the patcher.

    Please let me know if the integration is more complicated than I imagine it at present. :)

  3. ogerboss reporter

    htmlpopup.png

    Here's a screenshot from an html-enabled popup with the hyperlink-tooltip. :) I would appreciate it, if you could have a short glance at the new branch in my fork and tell me if I broke any SkyProc conventions I wasn't aware of. Would be a pity, if I make some obvious mistake and only realise it once I file a pull request.

    EDIT: Are there any documented guidelines for SkyProc contributors?

  4. Log in to comment