Returns null and does not cache when the source code of the script fails to load#76954
Conversation
|
I'm not going to review because I am not confident of my knowledge of a lot of this meta-gdscript stuff, but I am a little wary of this approach! My understanding is that GDScript tries pretty hard to not fail-fast, I think. If there's an error in parsing, we try to continue and parse as much as possible. I think that might be part of the reason why So I am particularly worried about changes in the user experience when people are writing code and causing certain errors as they edit. I wouldn't want half the project to halt/give errors because a single file currently has a parsing error. But this is just my very limited understanding, so I would love to hear more from @vnen and @adamscott! That said, I do think if there's an error, it ought to be reported by |
|
Previously, errors during loading were ignored. Now, all errors are not ignored. Judging in which period the error occurred, it can be judged based on the return value:
|
…ils to load This usually means that an `ERR_FILE*` error occurred. Previously, using `GDScriptCache::get_full_script()` would ignore errors during loading. Now, all errors are not ignored. Judging in which period the error occurred, it can be judged based on the return value: 1. null + err : Error during script loading (load_source_code()). 2. script + err: Error during script parsing.
33405de to
cbce374
Compare
|
Thanks! |
This usually means that an
ERR_FILE*error occurred.Fix #76941.
Previously, using
GDScriptCache::get_full_script()would ignore errors during loading. Now, all errors are not ignored.Judging in which period the error occurred, it can be judged based on the return value:
null+ err: Error during script loading (load_source_code()).script+ err: Error during script parsing.