File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,20 @@ function yyUnhandledExceptionHandler( event )
158
158
game_end ( - 1 ) ;
159
159
} // end if
160
160
else {
161
- var ret = g_GMLUnhandledExceptionHandler ( undefined , undefined , event . error ) ;
162
- game_end ( ret ) ;
161
+ let error = event . error ;
162
+
163
+ // Construct a GML struct to encapsulate the error details.
164
+ let errorStruct = { }
165
+ errorStruct . __type = "___struct___" ;
166
+ errorStruct . __yyIsGMLObject = true ;
167
+
168
+ // Add error details to the struct with a "gml" prefix for each member.
169
+ errorStruct . gmlmessage = error . message ;
170
+ errorStruct . gmlstacktrace = error . stack ;
171
+
172
+ // Pass the error struct to the custom error handler
173
+ var ret = g_GMLUnhandledExceptionHandler ( undefined , undefined , errorStruct ) ;
174
+ game_end ( ret ) ;
163
175
}
164
176
debugger ;
165
177
return false ;
You can’t perform that action at this time.
0 commit comments