Added hopefully more details in image parsing errors, ref #723
This commit is contained in:
@@ -526,7 +526,7 @@ namespace lms::scanner
|
||||
}
|
||||
catch (const image::Exception& e)
|
||||
{
|
||||
addError<EmbeddedImageScanError>(getFilePath(), index);
|
||||
addError<EmbeddedImageScanError>(getFilePath(), index, e.what());
|
||||
}
|
||||
|
||||
index++;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace lms::scanner
|
||||
catch (const image::Exception& e)
|
||||
{
|
||||
_parsedImageProperties.reset();
|
||||
addError<ImageFileScanError>(getFilePath());
|
||||
addError<ImageFileScanError>(getFilePath(), e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace lms::scanner
|
||||
|
||||
void ScanErrorLogger::visit(const scanner::EmbeddedImageScanError& error)
|
||||
{
|
||||
LMS_LOG(DBUPDATER, ERROR, "Failed to parse image in track file " << error.path << " at index " << error.index);
|
||||
LMS_LOG(DBUPDATER, ERROR, "Failed to parse image in track file " << error.path << " at index " << error.index << ": " << error.errorMsg);
|
||||
}
|
||||
|
||||
void ScanErrorLogger::visit(const scanner::NoAudioTrackFoundError& error)
|
||||
@@ -68,7 +68,7 @@ namespace lms::scanner
|
||||
|
||||
void ScanErrorLogger::visit(const scanner::ImageFileScanError& error)
|
||||
{
|
||||
LMS_LOG(DBUPDATER, ERROR, "Failed to read image file " << error.path);
|
||||
LMS_LOG(DBUPDATER, ERROR, "Failed to read image file " << error.path << ": " << error.errorMsg);
|
||||
}
|
||||
|
||||
void ScanErrorLogger::visit(const scanner::LyricsFileScanError& error)
|
||||
|
||||
@@ -95,9 +95,12 @@ namespace lms::scanner
|
||||
|
||||
struct EmbeddedImageScanError : public AudioFileScanError
|
||||
{
|
||||
EmbeddedImageScanError(const std::filesystem::path& p, unsigned i)
|
||||
EmbeddedImageScanError(const std::filesystem::path& p, unsigned i, std::string_view e)
|
||||
: AudioFileScanError{ p }
|
||||
, index{ i } {}
|
||||
, index{ i }
|
||||
, errorMsg{ e }
|
||||
{
|
||||
}
|
||||
|
||||
void accept(ScanErrorVisitor& visitor) const override
|
||||
{
|
||||
@@ -105,6 +108,7 @@ namespace lms::scanner
|
||||
}
|
||||
|
||||
unsigned index;
|
||||
std::string errorMsg;
|
||||
};
|
||||
|
||||
struct NoAudioTrackFoundError : public AudioFileScanError
|
||||
@@ -149,12 +153,16 @@ namespace lms::scanner
|
||||
|
||||
struct ImageFileScanError : public ScanError
|
||||
{
|
||||
using ScanError::ScanError;
|
||||
ImageFileScanError(const std::filesystem::path& p, std::string_view e)
|
||||
: ScanError{ p }
|
||||
, errorMsg{ e } {}
|
||||
|
||||
void accept(ScanErrorVisitor& visitor) const override
|
||||
{
|
||||
visitor.visit(*this);
|
||||
}
|
||||
|
||||
std::string errorMsg;
|
||||
};
|
||||
|
||||
struct LyricsFileScanError : public ScanError
|
||||
|
||||
Reference in New Issue
Block a user