File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,12 @@ fn main() -> Result<()> {
71
71
let _ = flag:: register ( SIGTERM , kill_signal. clone ( ) ) ?;
72
72
let _ = flag:: register ( SIGHUP , reload_signal. clone ( ) ) ?;
73
73
74
- let mut config_file = :: std:: fs:: read_to_string ( opts. config . clone ( ) ) ?;
74
+ let mut config_file = :: std:: fs:: read_to_string ( opts. config . clone ( ) ) . map_err ( |e| {
75
+ Error :: new (
76
+ e. kind ( ) ,
77
+ format ! ( "Failed to read config file from path: {}" , opts. config) ,
78
+ )
79
+ } ) ?;
75
80
let mut config: ServiceConfig = toml:: from_str ( & config_file) . map_err ( |e| {
76
81
Error :: new (
77
82
ErrorKind :: InvalidInput ,
@@ -110,7 +115,12 @@ fn main() -> Result<()> {
110
115
drop ( listener) ;
111
116
drop ( threadpool) ;
112
117
113
- config_file = :: std:: fs:: read_to_string ( opts. config . clone ( ) ) ?;
118
+ config_file = :: std:: fs:: read_to_string ( opts. config . clone ( ) ) . map_err ( |e| {
119
+ Error :: new (
120
+ e. kind ( ) ,
121
+ format ! ( "Failed to read config file from path: {}" , opts. config) ,
122
+ )
123
+ } ) ?;
114
124
config = toml:: from_str ( & config_file) . map_err ( |e| {
115
125
Error :: new (
116
126
ErrorKind :: InvalidInput ,
You can’t perform that action at this time.
0 commit comments