mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-22 15:39:04 +00:00
Expose filesystem errors on Writer.
This commit is contained in:
@@ -44,6 +44,14 @@ public:
|
||||
return file.write(buffer, bytes);
|
||||
}
|
||||
|
||||
Optional<std::filesystem::filesystem_error> error() const override {
|
||||
if( file.bad() ) {
|
||||
return { file.error() };
|
||||
} else {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
File file;
|
||||
};
|
||||
@@ -71,6 +79,14 @@ public:
|
||||
return success;
|
||||
}
|
||||
|
||||
Optional<std::filesystem::filesystem_error> error() const override {
|
||||
if( file.bad() ) {
|
||||
return { file.error() };
|
||||
} else {
|
||||
return { };
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
struct fmt_pcm_t {
|
||||
constexpr fmt_pcm_t(
|
||||
|
||||
Reference in New Issue
Block a user