How to avoid UE4 Editor crashing When i have no Visual Studio error?

Hi boys, i am tired of the Editor crashing ALL the time, i mean, ALL the time when i have some uncaught error in Visual Studio. I believe i have a lot of runtime errors, a logical thing since i am learning a lot of classes and the API.
If i instance a class the wrong way -No compile error- my Editor crashes.
If i forgot an argument in a function or constructor -No compile error- My editor Crashes
If i call a function or constructor with wrong arguments -No Compile error- My editor Crashes.
I can read the logs and try to find a solution but it is really time consuming when i have to open the editor every 2 minutes.
Some times my project get wrecked and i have to create a new project with the corresponding 10 minutes waiting for the editor to parse the project and build it.

is there any option to avoid the editor from crashing? it is anoying me, the compile times and the overall editor performances are not the best in the world and i would love to have a workaround :frowning:
Any ideas?? :smiley:

No, it’s normal that if there a problem in native code the program is crashing, thats essentially what crash is. UE4 has approuch that it reather crash it self in controlaable way and inform you about what happened then let unstable code caused by faulty code to continue running and crash without any information.

Editor crash because your game module becomes part of the engine and editor it self, so if your module crash the entire editor crash. You not first one to complain about it and there way to design it in better way, so maybe in future there will be something better?

Ok hahaha i suspected that, sounds rational. i will think its a normal proccess then :frowning: i thought that maybe there was a configurable XML or config file blah blah blha hahah

Sorry my dumb question but for you, is it a normal proccess? the constant crashes becouse of my/our inexpertise? will i have to get used to it ? :stuck_out_tongue:

What do you mean? Well if you will do errors in code you will have crashes. I also do mistakes and end up with crashes

haha never mind. errors are a common factor in programming. it is natural and normal in programming. never mind, it doesnt have any sense :slight_smile:
it doesnt matter man, i was refering to an anoying property of the editor, crashing the editor when there are no errors in visual studio, like no warnings , no red flag, no alert, just wasting time with those crashes, Hours and hours of wasted time, but at some point ill get used to it. Thank you :smiley:

Point of compileing is to generated from C++ the machine code (code run by CPU). Errors code is still good code for compiler.

If you write buggy code, you’re more than likely going to get crashes. When you do get crashes, you need to address the issue and fix it. When writing code, it is important that you test your code and make any potential fixes before actually using it. If you are not familiar with c++ programming, you should look up some basic tutorials and start there.

MJLaukala, i am a software engineer. i know what programming is about. Please read my last statement, i guess you didnt understand.
When you write code , NO ONE write code without errors the first time, and my Visual Studio is not reporting me any errors AT ALL, then i execute it in the editor and it crashes and the log pops up. Its ok, i can read the log and figure out the problem, but yesterday i was wondering that MAYBE there was an XML configurable file or something else that i can modify and avoid the editor from crashing. if it crash i have to lost like 10 minutes waiting for the editor restart, clean VS, rebuild VS and again fixing the error. I have an I7, 8Gb of Ram, and an SSD disk. and still it is a slow proccess, so that was what i was addressing here my friend, i am not an idiot programming. cheers :smiley: i think ill edit my first post to be more clearer hehe

sorry my friend, i didnt understand you :frowning:
Error Code is still good code for compiler ?
Somehow VS present no errors nor warnings but then, editor will crash → that is what i was pretending to fix(i was thinking maybe instead of a crash, a warning or stop the excecution when i hit play or something different than a crash hahaha) but you already told me it is impossible hahahahaha :smiley:

Gotchya. I’m just trying to give information that I think will help. The editor does catch some errors and places information in the output log which can be found under the Window->Developer Tools drop down menu. But it won’t be able to catch many errors that you introduce. All compile time errors should be caught by the compiler. But runtime errors can be caught and dealt with with your own checks. If you are not getting compile time errors when you think you should be, try setting your compiler to default settings.

aha :smiley: eyyy! i will try and investigate right now to use some Try Catch, i am soo dumb, i can maybe use that to avoid editor crashing :smiley: ey man thanks to you, your idea :smiley: i wil try that right now and see if it works :smiley:

Don’t use exceptions (Try, Catch) in UE4, It might mess things up in engine as UE4 code is not prepared for exceptions use, not to mention UE4 don’t have any helpful present exception. Simply if something can be null or object class different then you casting, do check in program behavior if you got null or wrong class. Thats how UE4 deal with in some cases and it does not crashing anything, sometimes it also logs error, for example if you use SpawnActor and spawn fail (for example you input wrong class) it will.log what went wrong in any situation (i seen code so i know ;p)

Yeah, i had read that, documentation doesnt recommend to use try-catch but anyways, it doesnt work, i tried some to to force a case that should trow an exception but doesnt work :frowning: documentation also says that we have some macros but like you said, it is only for checking if a pointer is null or not. So at this point i understand that we dont have any mechanism to protect the code/game/editor from crashing, any mechanism to avoid the crash and keep running the program, informing properly. :frowning: ill keep investigating this, and maybe ill create a new post asking for runtime protection mechanism, cheching null pointers is not just ok i think, tons of times a pointer checking is not a solution or a way to solve something :frowning: there must be something i am missing , ill keep investigating. Maybe i am missunderstanding something and thats ok, ill check what we have :slight_smile:

well, i am done with this, ill move forward, i wont stop for this, at some point ill manage to find a solution to the crash thing.
Thank you and MJLaukala for the hints :smiley: