[REL] Better Error Handling


What is it?
This mod attempts to improve upon the existing error handling in GDT which is a simple popup that barely gives any actual information.
The current error handling is both not user friendly as it is developer friendly because users have no idea what’s happening (vague popup) and developers can’t help the users because of the little information the popup provides.
This mod does not affect your gameplay, in any way, until the game hits an (uncaught) error of which it can’t recover, then this mod will come in to play.
It will collect data and dump it into a JSON object you can browse trough from the error page.
You can also copy this object and for example paste it on the forums or email it to GHG support.

Why?
Because I’m tired of the ‘I got an uncaught error’ posts that provide zero to nothing information on what the actual errror is, so I whipped up this little mod in a few hours.

This approach is:

  • More userfriendly
  • More developer friendly

Installation

  1. Create a folder called ‘jariz-error’ into your /mods/ directory
    (typically this would be at C:\Program Files (x86)\Steam\steamapps\common\Game Dev Tycoon\mods)
  2. Open the zip file you downloaded below and open the jariz-error-master folder.
  3. Open the jariz-error folder in your mods directory.
  4. Select all files in the jariz-error-master folder, and drag them into the jariz-error folder.

Credits
Bootstrap
PRETTYJSON

Source code
As always, on github:

Remarks
I do admit that there is a problem with this approach: The game scripts keep running and because this mod removes the entire DOM it might cause further errors, however, the mod blocks any further errors after showing the page, so you probably won’t even notice, however, your console will probably get spammed with exceptions.

6 Likes

Sooo I need to download those Bootstrap and Prettyjson?

Looks nice, and very useful/

No, they’re already included, I just added them as credit.
It’s simple drag’n’drop, just like any other mod.

Uhh, when ive installed your mod there is error that Error,js is missing or invaild. Well, I see Error.js in mods directory, so its not missing.

You should place the mod files in a folder called ‘jariz-error’.
For example the modAPI.js file should have the following path from the game dev tycoon folder:
\mods\jariz-error\modAPI.js
I will make this more clear in the main thread.

Oh, it was in folder jariz-error**-master**. Thank for the mod! Its working, and its brilliant!

1 Like

It helped me already :blush:

1 Like

Very handy Jari! :slight_smile:

1 Like

Hey @Jari

Would you like me to add this to the official mod list?

1 Like

Yea, absolutely, thanks!

Great mod, can easily help modders make mods in the future.

I made a new folder called jariz-error, put all the contents from the .zip into it, enabled it ingame, but I just get the same error dialog box as I would normally?

Erm, no idea. Could you send me a screenshot of your console?
To find out how to get to the console check out my tutorial:
http://forum.greenheartgames.com/t/tut-debug-game-dev-tycoon/8847

This is all I’m getting in the console. Seeing as nothing is related to your mod, I guess it’s on my end. I’ll try and re-install it. (If you’re wondering what PSC is, it’s my mod. Still trying to fix it) http://gyazo.com/ed003c8b1836f3cb6c51c46ce74003a8

1 Like

It’s probably because your mod is crashing before my mod’s loaded.
My mod only catches errors after it’s initialized.

doesn’t work :
Could not load mod one of the scripts mods/jariz-error/js/resources.js,mods/jariz-error/js/Error.js is missing or invalid!

Read other posts! I had same problem.

Bonjour j’ai ce problème la depuis que j’ai acheter le lab R&D

Why do You post it there?

1 Like

@mamouthe This is not an error with this mod

1 Like