summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/File.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibCore/File.cpp')
-rw-r--r--Libraries/LibCore/File.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibCore/File.cpp b/Libraries/LibCore/File.cpp
index 782960407c..41056701f0 100644
--- a/Libraries/LibCore/File.cpp
+++ b/Libraries/LibCore/File.cpp
@@ -33,11 +33,11 @@
namespace Core {
-RefPtr<File> File::open(const String& filename, IODevice::OpenMode mode, mode_t permissions)
+Result<NonnullRefPtr<File>, String> File::open(const String& filename, IODevice::OpenMode mode, mode_t permissions)
{
auto file = File::construct(filename);
if (!file->open_impl(mode, permissions))
- return nullptr;
+ return String(file->error_string());
return file;
}