1
1
using System ;
2
+ using System . Collections ;
3
+ using System . Collections . Generic ;
4
+ using System . IO ;
5
+ using System . Net . NetworkInformation ;
6
+ using System . Runtime . InteropServices ;
7
+ using Coderr . Client ;
8
+ using Coderr . Client . Contracts ;
9
+ using Coderr . Client . Uploaders ;
2
10
3
11
namespace Coderr . Client . Demo
4
12
{
13
+
5
14
class Program
6
15
{
7
16
static void Main ( )
8
17
{
9
- var url = new Uri ( "http://localhost:60473/" ) ;
18
+ //var url = new Uri("http://localhost:60473/");
19
+ //Err.Configuration.Credentials(url,
20
+ // "5a617e0773b94284bef33940e4bc8384",
21
+ // "3fab63fb846c4dd289f67b0b3340fefc");
22
+
23
+ var url = new Uri ( "https://report.coderr.io/" ) ;
10
24
Err . Configuration . Credentials ( url ,
11
- "1a68bc3e123c48a3887877561b0982e2" ,
12
- "bd73436e965c4f3bb0578f57c21fde69" ) ;
25
+ "d0c16767d68943dabe94dc581c45557c" ,
26
+ "88db0622561d4d1db389524e13901c22" ) ;
27
+
28
+ Err . Configuration . EnvironmentName = "Production" ;
13
29
14
- Err . ReportLogicError ( "User should have been assigned." ) ;
15
30
try
16
31
{
17
- throw new NotSupportedException ( "Not invented here ") ;
32
+ throw new InvalidOperationException ( "Hello ") ;
18
33
}
19
34
catch ( Exception ex )
20
35
{
21
- Err . Report ( ex , new { myData = "hello" , ErrTags = "important" } ) ;
36
+ //var report = Err.GenerateReport(ex, new { userId = 10, ErrTags = "important" });
37
+ //Err.UploadReport(report);
38
+ //Err.LeaveFeedback(report.ReportId, "[email protected] ", "This is what I did: NOTHING!");
39
+
40
+ Err . Report ( ex , new { userId = 10 , ErrTags = "console" } ) ;
22
41
}
42
+
43
+ Err . ReportLogicError ( "User should have been assigned." , errorId : "MainN" ) ;
44
+
45
+ ThrowImportantError ( ) ;
23
46
Console . WriteLine ( "Hello World!" ) ;
24
47
}
48
+
49
+ public static void ThrowImportantError ( )
50
+ {
51
+ try
52
+ {
53
+ throw new NotSupportedException ( "Not invented here" ) ;
54
+ }
55
+ catch ( Exception ex )
56
+ {
57
+ Err . Report ( ex , new
58
+ {
59
+ myData = "hello" ,
60
+ ErrTags = "important" ,
61
+ Adress =
62
+ new
63
+ {
64
+ City = "Falun"
65
+ }
66
+ } ) ;
67
+ }
68
+ }
25
69
}
26
70
}
0 commit comments