@@ -48,12 +48,19 @@ If a dictionary object has been passed use that object
4848
4949 LogUtility . InitLogConfig ( EnableLog , LogDirectory , LogFileName , LogfileMaxSize ) ;
5050
51- // Logger object is ready to Log
52- Logger . Trace ( "\n " ) ;
53- Logger . Trace ( "START> =======================================" ) ;
51+ try
52+ {
53+ // Logger object is ready to Log
54+ Logger . Trace ( "\n " ) ;
55+ Logger . Trace ( "START> =======================================" ) ;
5456
55- // Logging the source of properties' values
56- Logger . Trace ( "Reading Merchant Configuration from " + _propertiesSetUsing ) ;
57+ // Logging the source of properties' values
58+ Logger . Trace ( "Reading Merchant Configuration from " + _propertiesSetUsing ) ;
59+ }
60+ catch ( Exception e )
61+ {
62+ ExceptionUtility . Exception ( e . Message , e . StackTrace ) ;
63+ }
5764
5865 // Validations
5966 ValidateProperties ( ) ;
@@ -366,31 +373,31 @@ private void ValidateProperties()
366373 if ( string . IsNullOrEmpty ( KeyAlias ) )
367374 {
368375 KeyAlias = MerchantId ;
369- Logger . Warn ( $ "{ Constants . WarningPrefix } KeyAlias not provided. Assigning the value of: [MerchantID]") ;
376+ throw new Exception ( $ "{ Constants . WarningPrefix } KeyAlias not provided. Assigning the value of: [MerchantID]") ;
370377 }
371378
372379 if ( ! string . Equals ( KeyAlias , MerchantId ) )
373380 {
374381 KeyAlias = MerchantId ;
375- Logger . Warn ( $ "{ Constants . WarningPrefix } Incorrect value of KeyAlias provided. Assigning the value of: [MerchantID]") ;
382+ throw new Exception ( $ "{ Constants . WarningPrefix } Incorrect value of KeyAlias provided. Assigning the value of: [MerchantID]") ;
376383 }
377384
378385 if ( string . IsNullOrEmpty ( KeyPass ) )
379386 {
380387 KeyPass = MerchantId ;
381- Logger . Warn ( $ "{ Constants . WarningPrefix } KeyPassword not provided. Assigning the value of: [MerchantID]") ;
388+ throw new Exception ( $ "{ Constants . WarningPrefix } KeyPassword not provided. Assigning the value of: [MerchantID]") ;
382389 }
383390
384391 if ( string . IsNullOrEmpty ( KeyDirectory ) )
385392 {
386393 KeyDirectory = Constants . P12FileDirectory ;
387- Logger . Warn ( $ "{ Constants . WarningPrefix } KeysDirectory not provided. Using Default Path: { KeyDirectory } ") ;
394+ throw new Exception ( $ "{ Constants . WarningPrefix } KeysDirectory not provided. Using Default Path: { KeyDirectory } ") ;
388395 }
389396
390397 if ( string . IsNullOrEmpty ( KeyfileName ) )
391398 {
392399 KeyfileName = MerchantId ;
393- Logger . Warn ( $ "{ Constants . WarningPrefix } KeyfileName not provided. Assigning the value of: [MerchantId]") ;
400+ throw new Exception ( $ "{ Constants . WarningPrefix } KeyfileName not provided. Assigning the value of: [MerchantId]") ;
394401 }
395402
396403 P12Keyfilepath = KeyDirectory + "\\ " + KeyfileName + ".p12" ;
0 commit comments