Handling of invalid values in the Search, Search, Replace and Replace methods - #370
Conversation
chcg
commented
Jan 3, 2025
@Ekopalypse The original "request" was:
From that point I think your PR is a different approach and notifies the user about "invalid" or "problematic" input. |
alankilborn
commented
Jan 4, 2025
Well, nobody asked me, but:
|
Ekopalypse
commented
Jan 4, 2025
but the code logic is not aware of this. |
Uh oh!
There was an error while loading. Please reload this page.
alankilborn
commented
Jan 4, 2025
Ah, I see. |
Uh oh!
There was an error while loading. Please reload this page.
Ekopalypse
commented
Jan 4, 2025
Correct, this PR aims to prohibit empty strings as search arguments and None as search or replace arguments. |
alankilborn
commented
Jan 4, 2025
So, my choices will be, that every search I do after this PR is integrated will need to look like: iflen(find_text) ==0:
...
else:
editor.research(find_text, ...)or: try:
editor.research(...)
except:
...because we can't have the script user seeing the exception/traceback. I'm just trying to understand my options. :-) |
Ekopalypse
commented
Jan 4, 2025
I don't understand the question. You can still use |
alankilborn
commented
Jan 4, 2025
No worries; it was simply me rambling. :-)
No.
Yes. |
chcg
commented
Jan 4, 2025
@Ekopalypse@alankilborn So we start to go for the exception solution until a reasonable complain is coming up. |
fixes#172
Additional methods such as
editor.replaceSelmust be handled differently, as these are automatically generated by the iface file.