Gui OnEvent Error: Invalid callback function.

Propose new features and changes
iseahound
Posts: 1467
Joined: 13 Aug 2016, 21:04
Contact:

Gui OnEvent Error: Invalid callback function.

Post by iseahound » 12 Sep 2023, 21:30

Instead of saying Error: Invalid callback function, tell the user that the number of parameters in the callback is insufficient, and that they must allocate at least one for the GUI object.


lexikos
Posts: 9688
Joined: 30 Sep 2013, 04:07
Contact:

Re: Gui OnEvent Error: Invalid callback function.

Post by lexikos » 15 Sep 2023, 18:08

Impatient much? Why for this request? Surely you now know what to do when you get that message.

Indicating the parameter count is incorrect is one thing, but I am not going to include a verbose error message that includes conjecture about what the user's misconception is. What if the Gui isn't the missing parameter?

iseahound
Posts: 1467
Joined: 13 Aug 2016, 21:04
Contact:

Re: Gui OnEvent Error: Invalid callback function.

Post by iseahound » 15 Sep 2023, 19:47

Because it seems that there is something wrong with the function body or return value. Incorrect number of parameters, or requires at least one parameter?Either way "parameter" should be in the message

lexikos
Posts: 9688
Joined: 30 Sep 2013, 04:07
Contact:

Re: Gui OnEvent Error: Invalid callback function.

Post by lexikos » 15 Sep 2023, 20:11

@iseahound
I think you are answering a question which I did not ask. I already agreed that indicating the parameter count in the error message would be reasonable.
Because it seems that there is something wrong with the function body or return value.
I don't know what you mean. How could there be something wrong with the function body or return value? If there was a syntax error in the function body, it would be reported at load time. The return value can't be known until the function is called, which obviously isn't happening when OnEvent is called.

The callback function is invalid. There could be a number of causes, all of which should be found by comparing your callback function to the documentation.

User avatar
WarlordAkamu67
Posts: 231
Joined: 21 Mar 2023, 06:52

Re: Gui OnEvent Error: Invalid callback function.

Post by WarlordAkamu67 » 20 Sep 2023, 12:18

lexikos wrote:
15 Sep 2023, 18:08
Impatient much? Why for this request? Surely you now know what to do when you get that message.

Indicating the parameter count is incorrect is one thing, but I am not going to include a verbose error message that includes conjecture about what the user's misconception is. What if the Gui isn't the missing parameter?
:lol: apologies. I only ment to say, I second this request ^.^ I have encountered and fixed this issue, yes. I understand not bloating with specific errors for everything, and careful reading of the documentation can (and will) point you in the direction of solving it. There are also several forum topics about having this problem.

Post Reply

Return to “Wish List”