mirror of https://github.com/vitalif/grive2
don't throw even if can't read config
parent
c326a41d3a
commit
f2a659ce5e
|
@ -27,8 +27,7 @@ namespace gr {
|
||||||
const std::string& Config::Filename()
|
const std::string& Config::Filename()
|
||||||
{
|
{
|
||||||
static const char *env_cfg = ::getenv( "GR_CONFIG" ) ;
|
static const char *env_cfg = ::getenv( "GR_CONFIG" ) ;
|
||||||
static const std::string filename =
|
static const std::string filename = (env_cfg != 0) ? env_cfg : ".grive" ;
|
||||||
(env_cfg != 0) ? env_cfg : /*std::string( ::getenv( "HOME") ) +*/ ".grive_state" ;
|
|
||||||
|
|
||||||
return filename ;
|
return filename ;
|
||||||
}
|
}
|
||||||
|
@ -57,10 +56,11 @@ Json Config::Read( const std::string& filename )
|
||||||
}
|
}
|
||||||
catch ( Exception& e )
|
catch ( Exception& e )
|
||||||
{
|
{
|
||||||
throw Error()
|
// throw Error()
|
||||||
<< File( filename )
|
// << File( filename )
|
||||||
<< expt::ErrMsg("Cannot open config file ")
|
// << expt::ErrMsg("Cannot open config file ")
|
||||||
<< expt::Nested(e) ;
|
// << expt::Nested(e) ;
|
||||||
|
return Json() ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue