After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735729 - Give a better error message for non-existent volume
Give a better error message for non-existent volume
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: afp backend
1.21.x
Other Linux
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-30 21:30 UTC by Ross Lagerwall
Modified: 2014-10-13 21:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
afp: Give a better error message for non-existent volume (1.24 KB, patch)
2014-08-30 21:34 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2014-08-30 21:30:37 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
Comment 1 Ross Lagerwall 2014-08-30 21:34:17 UTC
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.
Comment 2 Ondrej Holy 2014-09-04 09:26:16 UTC
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?
Comment 3 Ross Lagerwall 2014-09-04 13:18:12 UTC
(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.
Comment 4 Ondrej Holy 2014-09-04 13:47:13 UTC
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.
Comment 5 Ross Lagerwall 2014-10-13 21:09:34 UTC
Pushed to master as 7d3d832326f5114c517100dae6bafbadf5e6648f with the suggested changes. Thanks for the review!