+
+(* This is called instead of when_read_directory when the read directory
+ * (or mount etc) failed. Convert the "Loading" entry into the
+ * error message.
+ *)
+and when_read_directory_fail ({ model = model } as t) path exn =
+ debug "when_read_directory_fail: %s" (Printexc.to_string exn);
+
+ match exn with
+ | G.Error msg ->
+ let row = model#get_iter path in
+ let row = model#iter_children ~nth:0 (Some row) in
+
+ let hdata = IsLeaf, ErrorMessage msg in
+ store_hdata t row hdata;
+
+ model#set ~row ~column:t.name_col (markup_escape msg)
+
+ | exn ->
+ (* unexpected exception: re-raise it *)
+ raise exn