I think it would be useful to be able to tap into the prototype changes tracking and blame other mods, by blaming the prototype when intentionally calling error
It would be an additional function signature akin to defining the level. Instead of blaming a function calls n levels up, it can blame error("that prototype right there, officer.", "type", "name")
It may be a little niche, but I can see it being very useful in places where people keep blaming one mod for the problems of another (ala Quality)
Add prototype descriptor to error function
Re: Add prototype descriptor to error function
To bump this and add more information 
I want to be able to declare a specific prototype as the cause of an issue, like this:
So when the error appears to the User, it taps into the prototype tracking and shows the error like a prototype error:

I want to be able to declare a specific prototype as the cause of an issue, like this:
Code: Select all
error("This prototype is in an invalid state for applying this affect to", type, name)
-
- Fast Inserter
- Posts: 234
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Add prototype descriptor to error function
+1. Would also greatly help for dynamic/automatic mods that create/modify entities ad nauseum.
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Re: Add prototype descriptor to error function
Hmm, but the actual error is not with *the other* mod, but your mod, no? Because if the player removes *your mod* the error goes away and the game continues to function.
If you want to get ahold of me I'm almost always on Discord.
Re: Add prototype descriptor to error function
That's why your mod will be listed as one of the ones at fault even if you're not on the history for that prototype.
I can concede that maybe the error should be specially formatted to provide emphasis on which mod threw it. Meaning this is less of a drop in idea like I was initially thinking.
I can concede that maybe the error should be specially formatted to provide emphasis on which mod threw it. Meaning this is less of a drop in idea like I was initially thinking.
-
- Fast Inserter
- Posts: 234
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Add prototype descriptor to error function
I thought i knew whet was being requested but know i dont... can you explain the proposed error message again?
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Re: Add prototype descriptor to error function
A way to error with prototype history (like prototype errors) if you're aborting because of a specific prototype.
Like so the Quality mod can also blame other mods, instead of just everyone thinking it's the Quality mod's fault some how. The Quality mod would still be listed in the blamed mods because it threw the error, even if it wasn't listed in the prototype history.
-
- Fast Inserter
- Posts: 234
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Add prototype descriptor to error function
Ah yes, i see. Yes, that would be awesome
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
-
- Fast Inserter
- Posts: 103
- Joined: Sat Aug 05, 2023 1:20 am
- Contact:
Re: Add prototype descriptor to error function
+1, having more "verbose" errors would be massively helpful for debugging in general and working on mod compatability
coder? i hardly know her!