@@ -15,12 +15,12 @@ public static Int32 ToInt32(object input)
1515 {
1616 output = Convert . ToInt32 ( input ) ;
1717 }
18- catch ( Exception e )
19- {
20- if ( e . Source != null )
21- {
22- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
23- }
18+ catch ( Exception e )
19+ {
20+ if ( e . Source != null )
21+ {
22+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
23+ }
2424 }
2525
2626 return output ;
@@ -34,12 +34,12 @@ public static bool ToBoolean(object input)
3434 {
3535 output = Convert . ToBoolean ( input ) ;
3636 }
37- catch ( Exception e )
38- {
39- if ( e . Source != null )
40- {
41- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
42- }
37+ catch ( Exception e )
38+ {
39+ if ( e . Source != null )
40+ {
41+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
42+ }
4343 }
4444
4545 return output ;
@@ -52,13 +52,13 @@ public static string ToString(object input, string defaultValue = "")
5252 try
5353 {
5454 output = Convert . ToString ( input ) ;
55- }
56- catch ( Exception e )
57- {
58- if ( e . Source != null )
59- {
60- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
61- }
55+ }
56+ catch ( Exception e )
57+ {
58+ if ( e . Source != null )
59+ {
60+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
61+ }
6262 }
6363
6464 return output ;
@@ -76,7 +76,7 @@ public static double ToDouble(object input)
7676 {
7777 if ( e . Source != null )
7878 {
79- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
79+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
8080 }
8181 }
8282
@@ -90,15 +90,15 @@ public static decimal ToDecimal(object input)
9090 try
9191 {
9292 output = Convert . ToDecimal ( input ) ;
93- }
94- catch ( Exception e )
95- {
96- if ( e . Source != null )
97- {
98- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
99- }
100- }
101-
93+ }
94+ catch ( Exception e )
95+ {
96+ if ( e . Source != null )
97+ {
98+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
99+ }
100+ }
101+
102102 return output ;
103103 }
104104
@@ -109,20 +109,20 @@ public static DateTime ToDateTime(object input)
109109 try
110110 {
111111 output = DateTime . Parse ( ContentstackConvert . ToString ( input ) ) ;
112- }
113- catch ( Exception e )
114- {
115- if ( e . Source != null )
116- {
117- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
118- }
119- }
120-
112+ }
113+ catch ( Exception e )
114+ {
115+ if ( e . Source != null )
116+ {
117+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
118+ }
119+ }
120+
121121 return output ;
122122 }
123123
124124 public static string ToISODate ( object input )
125- {
125+ {
126126 DateTime now = DateTime . Now ;
127127 try
128128 {
@@ -132,7 +132,7 @@ public static string ToISODate(object input)
132132 {
133133 if ( e . Source != null )
134134 {
135- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
135+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
136136 }
137137 }
138138 return now . ToString ( "yyyy'-'MM'-'dd'T'HH':'mm':'sszzz" ) ;
@@ -186,7 +186,7 @@ public static object GetValue(string value)
186186 {
187187 if ( e . Source != null )
188188 {
189- Console . WriteLine ( "IOException source: {0}" , e . Source ) ;
189+ Console . WriteLine ( "Exception in {0}: {1} \n StackTrace: {2} " , e . GetType ( ) . Name , e . Message , e . StackTrace ) ;
190190 }
191191 }
192192
@@ -222,8 +222,8 @@ public static RegexOptions GetRegexOptions(string option)
222222 return RegexOptions . None ;
223223 }
224224 }
225- }
226-
225+ }
226+
227227 public static Stream GenerateStreamFromString ( string s )
228228 {
229229 MemoryStream stream = new MemoryStream ( ) ;
@@ -232,7 +232,7 @@ public static Stream GenerateStreamFromString(string s)
232232 writer . Flush ( ) ;
233233 stream . Position = 0 ;
234234 return stream ;
235- }
235+ }
236236
237237 #endregion
238238
0 commit comments