-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shell_open not returning errors on Windows #52842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had no chance to build and test, but from the docs and my memory this looks good.
Any reason for not checking the other errors? |
Mostly not understanding what those situations are in detail and/or Godot not having a good error code to match it.
|
That's a bit risky if we ever change our error codes, might be better to match explicit with a |
Yeah, code should not depend on error enum members having a specific value, those will change. Otherwise this looks good to me, I'm fine with not mapping every value for now, returning a general error for some cases is fine and this is still a big improvement. I'll make a note to maybe have a look and add more when my error overhaul is far enough along. |
|
Also originally I added both like so: switch (ret) {
case ERROR_FILE_NOT_FOUND:
case SE_ERR_DLLNOTFOUND:
case SE_ERR_FNF:
return ERR_FILE_NOT_FOUND;
case ERROR_PATH_NOT_FOUND:
case SE_ERR_PNF:
return ERR_FILE_BAD_PATH;
.... But because they have the same error codes the compiler fails with duplicated |
Ah, yeah thats fine then, no way to avoid that. We could add a debug assert to ensure those are identical, but they're probably unlikely to change. |
Thanks! |
Cherry-picked for 3.4. |
Fixes #52794
Followed ShellExecuteW docs and tried to match most error codes.