don't throw even if can't read config

pull/40/head
Matchman Green 2012-05-17 20:55:51 +08:00
parent c326a41d3a
commit f2a659ce5e
1 changed files with 6 additions and 6 deletions

View File

@ -27,8 +27,7 @@ namespace gr {
const std::string& Config::Filename()
{
static const char *env_cfg = ::getenv( "GR_CONFIG" ) ;
static const std::string filename =
(env_cfg != 0) ? env_cfg : /*std::string( ::getenv( "HOME") ) +*/ ".grive_state" ;
static const std::string filename = (env_cfg != 0) ? env_cfg : ".grive" ;
return filename ;
}
@ -57,10 +56,11 @@ Json Config::Read( const std::string& filename )
}
catch ( Exception& e )
{
throw Error()
<< File( filename )
<< expt::ErrMsg("Cannot open config file ")
<< expt::Nested(e) ;
// throw Error()
// << File( filename )
// << expt::ErrMsg("Cannot open config file ")
// << expt::Nested(e) ;
return Json() ;
}
}