File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -204,18 +204,26 @@ internal static string Get(string key, string defaultValue = null)
204204
205205 public static void ReadStackifyJSONConfig ( string filePath )
206206 {
207- string json ;
208-
209- using ( var fs = new FileStream ( filePath , FileMode . Open , FileAccess . Read , FileShare . ReadWrite ) )
207+ try
210208 {
211- using ( var sr = new StreamReader ( fs ) )
209+ string json ;
210+
211+ using ( var fs = new FileStream ( filePath , FileMode . Open , FileAccess . Read , FileShare . ReadWrite ) )
212212 {
213- json = sr . ReadToEnd ( ) ;
213+ using ( var sr = new StreamReader ( fs ) )
214+ {
215+ json = sr . ReadToEnd ( ) ;
216+ }
214217 }
215- }
216218
217- var obj = JObject . Parse ( json , Settings ) ;
218- Config . SetStackifyObj ( obj ) ;
219+ var obj = JObject . Parse ( json , Settings ) ;
220+ Config . SetStackifyObj ( obj ) ;
221+ }
222+ catch ( Exception ex )
223+ {
224+ StackifyAPILogger . Log ( "#Config #ReadStackifyJSONConfig failed" , ex ) ;
225+ }
226+
219227 }
220228
221229 public static void SetStackifyObj ( JObject obj )
You can’t perform that action at this time.
0 commit comments