GNOME Bugzilla – Bug 735729
Give a better error message for non-existent volume
Last modified: 2014-10-13 21:09:44 UTC
The afp backend should give a better error message for a non-existent volume. E.g. the following is vague about the reason of failure: $ gvfs-mount afp://john@192.168.1.49/nonexistent Enter your password for the server “John’s Mac Pro”. Password: Error mounting location: Couldn't load nonexistent on John’s Mac Pro
Created attachment 284906 [details] [review] afp: Give a better error message for non-existent volume Give a better error message when trying to mount a volume that doesn't exist.
Review of attachment 284906 [details] [review]: ::: daemon/gvfsafpvolume.c @@ +139,3 @@ + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + _("Volume doesn't exist")); + goto error; Wouldn't be better to use return FALSE instead of goto?
(In reply to comment #2) > Review of attachment 284906 [details] [review]: > > ::: daemon/gvfsafpvolume.c > @@ +139,3 @@ > + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, > + _("Volume doesn't exist")); > + goto error; > > Wouldn't be better to use return FALSE instead of goto? I was trying to be consistent with the rest of the AFP code, yeah, return FALSE is simpler.
I know there are lot of goto commands in this code, but it doesn't make sense to jump only on return (if there isn't any memory releasing etc.). Also this should be committed after the string freeze.
Pushed to master as 7d3d832326f5114c517100dae6bafbadf5e6648f with the suggested changes. Thanks for the review!