MV/MZ SDJB_htmlError

PluginName: SDJB_htmlError
Author: ShadowDragon

Once the game crash, it give it on screen, reload the game (this does not return to game like default)!
realCrash.png


You can built custom crash and customize how retry button work or give it a different text!
custormCrash.png


Fully customized html error can be styles by CSS, custom titles can be styles too with different color.
if title does not exist in CSS, it becomes a white.

Spoiler: How it works
Code:
Introduction
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 This plugin adds a fake error or crash screen that can be fully customized
 to suit your game.

 Styling is handled through CSS and can also be applied to real game crashes.


 How to Use
 ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞ ͞
 To open the fake crash screen, use: htmlError.open().
 The available options are as follows:

 title:
   Adds a title to the crash screen (can be omitted if the title is "TypeError").
   Each title can be styled individually in CSS, including color,
   font size, and any other supported properties.

 message:
   Optional. Can be omitted depending on your needs.

 stack:
   Adds stack trace lines. Use "\n" for line breaks.

 buttonText:
   Sets the button text (can be omitted if the default is "Retry").

 onRetry:
   A function that is executed when the player clicks the button.


 Example:

   htmlError.open({
       title: "TypeError",
       message: "Your crash message",
       stack: "Add multiple lines\nhere and on the next\nand the next...\nas many as you like!",
       buttonText: "Crash Game",
       onRetry: () => {
            $gamePlayer.reserveTransfer(5, 7, 12, 2, 0);
            // $gamePlayer.reserveTransfer(mapID, x, y, direction, fade);
       }
   });


 You can also create a manual stack error sequence:

   htmlError.open({
       title: "ReferenceError",
       message: "undefined is not a function",
       onRetry: () => {
           htmlError.open({
               title: "LoadError",
               message: "Failed to load: audio/bgm/ghost_theme.ogg",
               onRetry: () => {
                   htmlError.open({
                       title: "LoadError",
                       message: "Endless loop error",
                       onRetry: () => {
                           // Exit cleanly, call a script, or chain more errors
                       }
                   });
               }
           });
       }
   });

Download from itch.io (require my SDJB_htmlBase!)

=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB


=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.

Original thread: https://forums.rpgmakerweb.com/threads/sdjb_htmlerror.183235/