From 018df355f0afa18b58e2ef3f3e36745b944a3b63 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 8 May 2022 19:36:02 +0100 Subject: [PATCH] Replace some VFS exceptions with warnings These errors aren't necessarily fatal so tone them down. --- app/src/main/cpp/skyline/vfs/backing.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/cpp/skyline/vfs/backing.h b/app/src/main/cpp/skyline/vfs/backing.h index 713e3944..a69c2715 100644 --- a/app/src/main/cpp/skyline/vfs/backing.h +++ b/app/src/main/cpp/skyline/vfs/backing.h @@ -56,7 +56,7 @@ namespace skyline::vfs { */ size_t ReadUnchecked(span output, size_t offset = 0) { if (!mode.read) - throw exception("Attempting to read a backing that is not readable"); + Logger::Warn("Attempting to read a backing that is not readable"); return ReadImpl(output, offset); }; @@ -75,7 +75,7 @@ namespace skyline::vfs { throw exception("Trying to read past the end of a backing: 0x{:X}/0x{:X} (Offset: 0x{:X})", output.size(), size, offset); if (ReadUnchecked(output, offset) != output.size()) - throw exception("Failed to read the requested size from backing"); + Logger::Warn("Failed to read the requested size from backing"); return size; }; @@ -108,13 +108,13 @@ namespace skyline::vfs { */ size_t Write(span input, size_t offset = 0) { if (!mode.write) - throw exception("Attempting to write to a backing that is not writable"); + Logger::Warn("Attempting to write to a backing that is not writable"); if (input.size() > (static_cast(size) - static_cast(offset))) { if (mode.append) Resize(offset + input.size()); else - throw exception("Trying to write past the end of a non-appendable backing: 0x{:X}/0x{:X} (Offset: 0x{:X})", input.size(), size, offset); + Logger::Warn("Trying to write past the end of a non-appendable backing: 0x{:X}/0x{:X} (Offset: 0x{:X})", input.size(), size, offset); } return WriteImpl(input, offset); @@ -129,7 +129,7 @@ namespace skyline::vfs { void WriteObject(const T &object, size_t offset = 0) { size_t lSize; if ((lSize = Write(span(reinterpret_cast(&object), sizeof(T)), offset)) != sizeof(T)) - throw exception("Object wasn't written fully into output backing: {}/{}", lSize, sizeof(T)); + Logger::Warn("Object wasn't written fully into output backing: {}/{}", lSize, sizeof(T)); } /**