Carpet

Carpet

2M Downloads

Loading an app where a function invoked via the custom command system is not found returns ambiguous error message

James103 opened this issue ยท 3 comments

commented

Loading an app with the following code results in the generic "unexpected error" message and the app failing to load. I would expect the error message to say something like "function is not defined yet".

__config() -> {
	'commands' -> {
		'test <x>' -> 'not_found', // function is not defined elsewhere in the app
		...
	},
};

Version: Carpet mod 1.4.18, Minecraft 1.16.4

commented

well, you if you hover over the red error message, you have a tooltip telling that Function not_found is not defined yet. I am just using here vanilla error messaging when running a command - maybe I should be using scarpet error messaging here instead.

commented

question is - should I treat these errors as 'scarpet' errors or 'command system' errors? They will end up as command errors, but raising it as scarpet error will get you the stacktrace and a code pointer.

commented

Based on the pros and cons, I think showing a scarpet error would be better.