Skip to content

Commit e63eee1

Browse files
committed
Avoid try-catch blocks when reading PBM file.
1 parent adc7ab4 commit e63eee1

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/bin/daemon/LCDPlugins/LCDPlugin.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,12 @@ void LCDPlugin::addPBMFrame(
166166

167167
this->addPBMEmptyFrame(num);
168168

169-
try {
170-
this->readPBM(
171-
filePath.string(),
172-
_PBMFrames.back()._PBMData,
173-
DEFAULT_PBM_WIDTH,
174-
DEFAULT_PBM_HEIGHT
175-
);
176-
}
177-
catch (const GLogiKExcept & e) {
178-
LOG(ERROR) << "exception while reading PBM file: " << filePath.string();
179-
throw;
180-
}
169+
this->readPBM(
170+
filePath.string(),
171+
_PBMFrames.back()._PBMData,
172+
DEFAULT_PBM_WIDTH,
173+
DEFAULT_PBM_HEIGHT
174+
);
181175
}
182176

183177
void LCDPlugin::addPBMEmptyFrame(

src/bin/daemon/LCDPlugins/PBMFile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void PBMFile::readPBM(
6767
pbm.close();
6868
}
6969
catch (const std::ios_base::failure & e) {
70-
LOG(ERROR) << "error opening/reading/closing PBM file : " << e.what();
70+
LOG(ERROR) << "error opening/reading/closing PBM file : "
71+
<< PBMPath << " : " << e.what();
7172
throw GLogiKExcept("PBM ifstream error");
7273
}
7374
}

0 commit comments

Comments
 (0)