FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Arduino/Solid.Arduino.Test/ExceptionMonitor.cs at master · SolidSoils/Arduino · GitHub
SolidSoils
Arduino
Repository navigation
Code
Issues
8
(8)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Arduino
/
Solid.Arduino.Test
/
ExceptionMonitor.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (23 loc) · 1 KB
Breadcrumbs
Arduino
/
Solid.Arduino.Test
/
ExceptionMonitor.cs
Copy path
File metadata and controls
25 lines (23 loc) · 1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using
System
;
using
System
.
Runtime
.
ExceptionServices
;
using
System
.
Reflection
;
namespace
Solid
.
Arduino
.
Test
{
class
ExceptionMonitor
{
public
void
Setup
(
)
{
// Het FirstChanceException event gaat af als er een Exception optreedt in je applicatie.
// Dit gebeurt nog voordat foutafhandeling (catch) in actie heeft kunnen komen. Dit maakt
// deze event bij uitstek geschikt om te analyseren in welke mate een applicatie leunt op
// 'handled exceptions', wat een forse impact op de performance kan hebben.
AppDomain
.
CurrentDomain
.
FirstChanceException
+=
FirstChanceHandler
;
}
static
void
FirstChanceHandler
(
object
o
,
FirstChanceExceptionEventArgs
e
)
{
MethodBase
site
=
e
.
Exception
.
TargetSite
;
Console
.
WriteLine
(
"Thrown in module {0}, by {1}({2})"
,
site
.
Module
,
site
.
DeclaringType
,
site
.
ToString
(
)
)
;
Console
.
WriteLine
(
"Stack trace:
\n
{0}"
,
e
.
Exception
.
StackTrace
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL