removed fragile error handling

This commit is contained in:
Koisu 2025-06-24 11:28:51 -07:00
parent b556dac2c1
commit a6f1981afb
2 changed files with 8 additions and 6 deletions

View file

@ -87,18 +87,18 @@ namespace Flow.Launcher.Plugin.Explorer.Helper
case ElementAlreadyExistsException:
api.ShowMsgError(string.Format(api.GetTranslation("plugin_explorer_element_already_exists"), NewFileName));
break;
case IOException iOException:
if (iOException.Message.Contains("incorrect"))
default:
string msg = exception.Message;
if (!string.IsNullOrEmpty(msg))
{
api.ShowMsgError(string.Format(api.GetTranslation("plugin_explorer_invalid_name"), NewFileName));
api.ShowMsgError(string.Format(api.GetTranslation("plugin_explorer_exception"), exception.Message));
return;
}
else
{
goto default;
api.ShowMsgError(api.GetTranslation("plugin_explorer_no_reason_given_exception"));
}
default:
api.ShowMsgError(exception.ToString());
return;
}
}

View file

@ -203,4 +203,6 @@
<system:String x:Key="plugin_explorer_successful_rename">Successfully renamed it to: {0}</system:String>
<system:String x:Key="plugin_explorer_element_already_exists">There is already a file with the name: {0} in this location</system:String>
<system:String x:Key="plugin_explorer_failed_to_open_rename_dialog">Failed to open rename dialog.</system:String>
<system:String x:Key="plugin_explorer_exception">An error occured: {0}.</system:String>
<system:String x:Key="plugin_explorer_no_reason_given_exception">An error occured and no reason was given.</system:String>
</ResourceDictionary>