WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
90 stars 20 forks source link

Improve missing reference error message #167

Closed burner1024 closed 4 years ago

burner1024 commented 4 years ago
OUTER_SPRINT trap_type_warning (AT trap_type_warning) // trap warning string from tra

trap_type_warning was not set, so the installation failed. The error message is pretty cryptic, took me a while to figure out:

Extended script [g_tr55.bcs] with [tnt/components/easy_traps/traps.baf]
Copying 1 file ...
Copied [GT029.bcs] to [override/g_tr56.bcs]
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [Improved trap detection: core (REQUIRED for any of previous "Improved trap detection" components to work)], rolling back to previous state
[tnt/backup/9/UNSETSTR.9] SET_STRING uninstall info not found
Will uninstall  93 files for [tnt/tnt.tp2] component 9.
Uninstalled     93 files for [tnt/tnt.tp2] component 9.
Unable to Unlink [tnt/backup/9/READLN.9]: Unix.Unix_error(Unix.ENOENT, "unlink", "tnt/backup/9/readln.9")
Unable to Unlink [tnt/backup/9/READLN.9.TEXT]: Unix.Unix_error(Unix.ENOENT, "unlink", "tnt/backup/9/readln.9.text")
DDRAWFIX/DDRAWFIX.TP2  0  0 Installed

Maybe it could be clarified?

FredrikLindgren commented 4 years ago

Can you provide more context about the code that generated the error? If I just run the TP2 you posted, I get the error message I expect:

ERROR: cannot convert trap_type_warning or %trap_type_warning% to an integer
Stopping installation because of error.

This happens if I either leave trap_type_warning unset or if i set it to a not-integer.

burner1024 commented 4 years ago

OK, I feel stupid, but I can't reproduce it now. I'm fairly certain that in some cases WeiDU won't print the name of variable/reference that is missing, though. If/when I hit it again, I'll get back with a complete case.