Browse Source

Tweak error messages

coverity_scan
Daniel Scharrer 13 years ago
parent
commit
7d7e78d83e
  1. 2
      src/stream/chunk.cpp
  2. 8
      src/stream/slice.cpp

2
src/stream/chunk.cpp

@ -65,7 +65,7 @@ bool chunk::operator==(const chunk & o) const {
chunk_reader::pointer chunk_reader::get(slice_reader & base, const chunk & chunk) {
if(!base.seek(chunk.first_slice, chunk.offset)) {
throw chunk_error("error seeking to chunk start");
throw chunk_error("could not seek to chunk start");
}
char magic[ARRAY_SIZE(chunk_id)];

8
src/stream/slice.cpp

@ -96,7 +96,7 @@ bool slice_reader::open_file(const path_type & file) {
char magic[8];
if(ifs.read(magic, 8).fail()) {
ifs.close();
throw slice_error("error reading slice magic number");
throw slice_error("could not read slice magic number");
}
bool found = false;
for(size_t i = 0; ARRAY_SIZE(slice_ids); i++) {
@ -113,7 +113,7 @@ bool slice_reader::open_file(const path_type & file) {
slice_size = util::load<boost::uint32_t>(ifs);
if(ifs.fail()) {
ifs.close();
throw slice_error("error reading slice size");
throw slice_error("could not read slice size");
} else if(std::streampos(slice_size) > file_size) {
ifs.close();
std::ostringstream oss;
@ -170,9 +170,9 @@ bool slice_reader::open(size_t slice, const path_type & file) {
}
if(dir != last_dir) {
log_error << "error opening " << slice_file << " in " << last_dir << " or " << dir;
log_error << "could not open " << slice_file << " in " << last_dir << " or " << dir;
} else {
log_error << "error opening " << last_dir / slice_file;
log_error << "could not open " << last_dir / slice_file;
}
return false;

Loading…
Cancel
Save