summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2024-04-11 22:23:05 -0300
committerFrederico Linhares <fred@linhares.blue>2024-04-11 22:49:08 -0300
commite0f8999d9525dd1ac46762a3b8629a1a3eaa7bd7 (patch)
treeac42ca7e69d9ac0ff2b1302b640d49ea264148b3 /src
parent0bd787b86f891f2c363e2a9e9475cfc624954293 (diff)
feat Improve error message for BinaryReader
Diffstat (limited to 'src')
-rw-r--r--src/binary_reader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/binary_reader.cpp b/src/binary_reader.cpp
index 04633a2..0727703 100644
--- a/src/binary_reader.cpp
+++ b/src/binary_reader.cpp
@@ -37,7 +37,12 @@ BinaryReader::BinaryReader(std::string file_path):
_pointer{0}
{
std::ifstream file(file_path, std::ios::binary | std::ios::ate);
- if(!file.is_open()) throw std::runtime_error{"failed to open file"};
+ if(!file.is_open())
+ {
+ std::string error{"failed to open file: "};
+ error += file_path;
+ throw std::runtime_error{error};
+ }
this->_size = file.tellg();
file.seekg(0);