From 6196b0357e1aa10a77b5bc7da7eea701397e8129 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 17 Sep 2024 21:49:01 +0200 Subject: [PATCH] internal/driver/mobile: return storage.ErrNotExists instead of custom error Fixes #3353. --- internal/driver/mobile/file_android.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/driver/mobile/file_android.go b/internal/driver/mobile/file_android.go index b266c92916..1bbf82297e 100644 --- a/internal/driver/mobile/file_android.go +++ b/internal/driver/mobile/file_android.go @@ -25,6 +25,7 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/internal/driver/mobile/app" + "fyne.io/fyne/v2/storage" "fyne.io/fyne/v2/storage/repository" ) @@ -90,7 +91,7 @@ func nativeFileOpen(f *fileOpen) (io.ReadCloser, error) { ret := openStream(f.uri.String()) if ret == nil { - return nil, errors.New("resource not found at URI") + return nil, storage.ErrNotExists } stream := &javaStream{} @@ -122,7 +123,7 @@ func nativeFileSave(f *fileSave) (io.WriteCloser, error) { ret := saveStream(f.uri.String()) if ret == nil { - return nil, errors.New("resource not found at URI") + return nil, storage.ErrNotExists } stream := &javaStream{}