Add a friendly error message if installation fails due to lack of disk space.

This commit is contained in:
Robert Knight 2011-09-15 15:09:19 +01:00
parent 274b433120
commit ef9ceb03f0
3 changed files with 7 additions and 1 deletions

View file

@ -67,6 +67,8 @@ FileUtils::IOException::Type FileUtils::IOException::type() const
return NoError;
case EROFS:
return ReadOnlyFileSystem;
case ENOSPC:
return DiskFull;
default:
return Unknown;
}

View file

@ -32,7 +32,8 @@ class FileUtils
* provided by the OS.
*/
Unknown,
ReadOnlyFileSystem
ReadOnlyFileSystem,
DiskFull
};
virtual const char* what() const throw ()

View file

@ -87,6 +87,9 @@ std::string UpdateInstaller::friendlyErrorForError(const FileUtils::IOException&
"Re-install it to a location that can be updated and run it from there.";
#endif
break;
case FileUtils::IOException::DiskFull:
friendlyError = "The disk is full. Please free up some space and try again.";
break;
default:
break;
}