Page 1 of 1

Providing a more precise target of where the script crashed

Posted: Sat Dec 22, 2018 9:03 pm
by JakSparro98
Today's situation is if some scripts crashes you are aware only of the stack trace, without the line were the crash occurred.

The exception thrown by the script engine should be handled by specifying the line of code that failed, I probably guess that a reason why that is already implemented is because the code changes morphology when the temp file is created to handle the script so the line error will result in a wrong line catch because of various file optimizations, I will suggest at least specifying the last tried action before crashing in case the other way isn't feasible,e.g.

Code: Select all

void KillPlayer()
{
IPlayer plr=null;
plr.Kill();
count++;
}
The exception should show that the script crashed on IPlayer.Kill() at the function KillPlayer()

Another thing could be showing the last completed actions before the crash, in this case IPlayer a=null;

EDIT:
I want to specify that this suggestion is referring to visualizing a more detailed script crash error for the normal user that need to report the issue when he finds one, I'm not referring to better developer debugging techniques.

Re: Providing a more precise target of where the script crashed

Posted: Sun Dec 23, 2018 8:05 am
by Sree
You could use visual studio debugger for this

here's how the example in your thread would look like in debugger
Image

Re: Providing a more precise target of where the script crashed

Posted: Sun Dec 23, 2018 3:08 pm
by JakSparro98
Sree wrote:
Sun Dec 23, 2018 8:05 am
You could use visual studio debugger for this

here's how the example in your thread would look like in debugger
Image
I can assume that it was a way too simple example where every compiler will tell you that the variable is not initialized, what I'm trying to say is that if the error occurs at runtime, because of some logic mistakes, where the map/script is shared on Steam, an user won't be able to report you an effective error message rather than what method failed.

Re: Providing a more precise target of where the script crashed

Posted: Sun Dec 23, 2018 4:01 pm
by Sree
JakSparro98 wrote:
Sun Dec 23, 2018 3:08 pm
I can assume that it was a way too simple example where every compiler will tell you that the variable is not initialized, what I'm trying to say is that if the error occurs at runtime, because of some logic mistakes, where the map/script is shared on Steam, an user won't be able to report you an effective error message rather than what method failed.
that screenshot wasn't an error displayed by the compiler, it was the visual studio's debugger in action which showed the exception raised and the source of it, also this was recorded during run-time because a logical error.. so don't get what you are trying to say.

if what you are trying to propose is for the script users to be notified where and why an exception was raised, then you should specify that in the thread.

Re: Providing a more precise target of where the script crashed

Posted: Sun Dec 23, 2018 4:18 pm
by JakSparro98
Sree wrote:
Sun Dec 23, 2018 4:01 pm
that screenshot wasn't an error displayed by the compiler, it was the visual studio's debugger in action which showed the exception raised and the source of it [..]
I see, I thought it was an exception warning like java does.
Sree wrote:
Sun Dec 23, 2018 4:01 pm
if what you are trying to propose is for the script users to be notified where and why an exception was raised, then you should specify that in the thread.
Yeah, even because this thread explains that you can attach VS and that is made for debugging the code when something happen on the developer's view, but when something is occurring when a user is playing is another story, and this latter is what I want to enhance.