Skip to content
Snippets Groups Projects
Commit 6f411470 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed exception catching and a typo in File.hpp.

parent 649bf42b
No related branches found
No related tags found
1 merge request!29Revision
...@@ -45,14 +45,14 @@ inline void File::open( const String& fileName, Mode mode ) ...@@ -45,14 +45,14 @@ inline void File::open( const String& fileName, Mode mode )
{ {
file.open( fileName.getString(), ios_mode ); file.open( fileName.getString(), ios_mode );
} }
catch( std::ios_base::failure ) catch( std::ios_base::failure& )
{ {
std::stringstream msg; std::stringstream msg;
msg << "Unable to open file " << fileName << " "; msg << "Unable to open file " << fileName << " ";
if( mode & Mode::In ) if( mode & Mode::In )
msg << " for reading."; msg << " for reading.";
if( mode & Mode::Out ) if( mode & Mode::Out )
msg << " for writting."; msg << " for writing.";
throw std::ios_base::failure( msg.str() ); throw std::ios_base::failure( msg.str() );
} }
...@@ -68,7 +68,7 @@ inline void File::close() ...@@ -68,7 +68,7 @@ inline void File::close()
{ {
file.close(); file.close();
} }
catch( std::ios_base::failure ) catch( std::ios_base::failure& )
{ {
std::stringstream msg; std::stringstream msg;
msg << "Unable to close file " << fileName << "."; msg << "Unable to close file " << fileName << ".";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment