Kirsle.net logo Kirsle.net

Error Message Generator 2.0

Project Description

The Error Message Generator (ErrorGen) is a simple program that lets you create customized error dialogs. The idea was originally inspired by a web-based tool called "Atom Smasher's Error Message Generator" (RIP) which created images of error boxes. My program, however, creates "real" error boxes that can be dragged around the screen and interacted with.

🎁 NEW in January 2023: I have recreated my program from scratch and released a new "2.0" version for the modern era - details below. My original 2006 version is still available here.

Screenshot of ErrorGen 2.0

Way back in 2006 while I was still in high school, I had created my original ErrorGen program (written in Perl/Tk) in one afternoon and released it on my site. After Atom Smasher's site went down in 2022, I have seen an uptick of interest for my ErrorGen program - which was last compiled in 2008 for Windows XP and shows its age and doesn't run very easily on Windows 11 in 2023.

So, on January 21, 2023 I built a new successor to ErrorGen, this time in Go and to explore the Fyne UI toolkit. The "2.0.0" release of ErrorGen has equivalent functionality to my original Perl app, and the command-line interface I previously called ZenMsg is built-in to the same binary as the graphical ErrorGen tool. You can call ErrorGen from batch files or shell scripts if you want to ask the user a quick question!

Looking for my classic Perl ErrorGen from 2006? See over here for the original ErrorGen page.

Features

This program has two main use cases:

  • The default, MainWindow Mode shows a graphical UI where users can configure a custom error message dialog box to prank their friends with.
    • Select from one of the 72 original Atom Smasher icon images.
    • Enter a custom Title and Message for your error dialog.
    • Configure up to three buttons with custom text and mark some as disabled or greyed-out.
    • Create as many pop-up error dialogs as you want. You can also hide the MainWindow when your error box appears so that the control window is hidden and you can leave the error on screen to prank your friends!
  • It also has a command line interface where you can invoke a custom dialog box from batch files or shell scripts, for example if you want to ask the user a question.
    • The user's selected answer is printed to ErrorGen's standard output so can be read by the calling program.
    • You can use a custom icon image (PNG).
    • You can include more than three buttons if you want, and mark which ones are disabled or the default (blue) button.
    • You can set a "cancel button" that is picked if the user hits the Escape key or X's out of the window without clicking on one of the buttons.

The 2.0.0 release reproduces most of the features the original Perl version had, including the command line interface which is now built-in to the one program instead of having the separate ZenMsg binary. But I don't plan on stopping there: I have some fun ideas to add to ErrorGen in the future as well:

  • Flesh out the command line interface further to create something even more useful for shell scripts, with features on par with GNOME's Zenity and similar tools (e.g., file selection dialogs).
  • On the MainWindow add a "Save" button that can turn your custom error dialog into a batch file or shell script that you can save to disk. The script would invoke the command line interface to show your dialog - creating an easy shortcut that just pops up your dialog without the MainWindow also appearing, for fun and pranks.
  • On the MainWindow extend the library of built-in icons and allow users to easily browse and pick their own icon images. Similarly, the selectbox drop-down of icons I want to change into a grid view like the Perl version had for ease of use; this is my first Fyne GUI project in Go and still learning the ropes!

Command Line Interface

You can call this program from batch files or shell scripts to prompt the user with a graphical dialog box and read the button they chose from this program's standard output.

For example, from a bash script:

#!/bin/bash
answer=`./errorgen --alert --title "Disk Failure" \
    --text "Failure to read from drive Z:/" \
    --icon defrag --button Abort --button Retry --button Fail \
    --default 1 --cancel Fail`
echo "You have chosen: $answer"

Screenshot from the above command

The full documentation is included below. Running errorgen --help from a text terminal will have the program print its documentation to you, but this won't work on the Windows version since a program must decide if it's a graphical or a command line app and can't be both.

Download

I package this program for Windows and Linux for 64-bit and 32-bit x86 architectures.

Windows

Windows icon 64-bit: Download Error Message Generator
7.0 MiB ZIP; Version 2.0.0

Windows icon 32-bit: Download Error Message Generator
6.8 MiB ZIP; Version 2.0.0

Linux

Binary icon 64-bit: Download Error Message Generator
7.1 MiB tar.gz; Version 2.0.0

Binary icon 32-bit: Download Error Message Generator
6.8 MiB tar.gz; Version 2.0.0

Source

The source code to ErrorGen 2.0 is hosted on my Gitea instance at:

https://git.kirsle.net/apps/errorgen

The program should compile anywhere that Go and Fyne work, including on macOS.

It is released under the GNU General Public License version 3.