@@ -57,7 +57,9 @@ private static Error ToErrorModelInternal(Exception exception, ExceptionlessClie
57
57
PropertyInfo info = type . GetProperty ( "HResult" , BindingFlags . Public | BindingFlags . Instance ) ;
58
58
if ( info != null )
59
59
error . Code = info . GetValue ( exception , null ) . ToString ( ) ;
60
- } catch ( Exception ) { }
60
+ } catch ( Exception ex ) {
61
+ log . Error ( typeof ( ExceptionlessClient ) , ex , "Error populating HResult Code: " + ex . Message ) ;
62
+ }
61
63
62
64
#if NET45
63
65
try {
@@ -93,7 +95,9 @@ private static Error ToErrorModelInternal(Exception exception, ExceptionlessClie
93
95
var extraProperties = type . GetPublicProperties ( ) . Where ( p => ! p . Name . AnyWildcardMatches ( exclusions , true ) ) . ToDictionary ( p => p . Name , p => {
94
96
try {
95
97
return p . GetValue ( exception , null ) ;
96
- } catch { }
98
+ } catch ( Exception ex ) {
99
+ log . Error ( typeof ( ExceptionlessClient ) , ex , String . Format ( "Error getting extra exception property {0} value: {1}" , p . Name , ex . Message ) ) ;
100
+ }
97
101
return null ;
98
102
} ) ;
99
103
@@ -107,7 +111,9 @@ private static Error ToErrorModelInternal(Exception exception, ExceptionlessClie
107
111
MaxDepthToSerialize = 5
108
112
} , client ) ;
109
113
}
110
- } catch { }
114
+ } catch ( Exception ex ) {
115
+ log . Error ( typeof ( ExceptionlessClient ) , ex , "Error populating extra exception properties: " + ex . Message ) ;
116
+ }
111
117
112
118
if ( exception . InnerException != null )
113
119
error . Inner = ToErrorModelInternal ( exception . InnerException , client , true ) ;
@@ -164,7 +170,9 @@ internal static ModuleCollection GetLoadedModules(IExceptionlessLog log, bool in
164
170
var attrs = assembly . GetCustomAttributes ( typeof ( System . CodeDom . Compiler . GeneratedCodeAttribute ) ) . ToList ( ) ;
165
171
if ( attrs . Count > 0 )
166
172
continue ;
167
- } catch { }
173
+ } catch ( Exception ex ) {
174
+ log . Error ( typeof ( ExceptionlessClient ) , ex , "Error while checking if assembly " + assembly . FullName + " should be added to modules:" + ex . Message ) ;
175
+ }
168
176
}
169
177
170
178
var module = assembly . ToModuleInfo ( ) ;
@@ -185,10 +193,15 @@ private static void PopulateStackTrace(this Error error, Error root, Exception e
185
193
try {
186
194
var st = new EnhancedStackTrace ( exception ) ;
187
195
frames = st . GetFrames ( ) ;
188
- } catch { }
196
+ }
197
+ catch ( Exception ex ) {
198
+ log . Error ( typeof ( ExceptionlessClient ) , ex , "Error getting stack frames: " + ex . Message ) ;
199
+ }
189
200
190
- if ( frames == null )
201
+ if ( frames == null || frames . Length == 0 ) {
202
+ log . Info ( typeof ( ExceptionlessClient ) , "Error " + error . Message + " contained no stack frames" ) ;
191
203
return ;
204
+ }
192
205
193
206
foreach ( StackFrame frame in frames ) {
194
207
var stackFrame = new Models . Data . StackFrame {
0 commit comments