11using 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 ;
210
311namespace Coderr . Client . Demo
412{
13+
514 class Program
615 {
716 static void Main ( )
817 {
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/" ) ;
1024 Err . Configuration . Credentials ( url ,
11- "1a68bc3e123c48a3887877561b0982e2" ,
12- "bd73436e965c4f3bb0578f57c21fde69" ) ;
25+ "d0c16767d68943dabe94dc581c45557c" ,
26+ "88db0622561d4d1db389524e13901c22" ) ;
27+
28+ Err . Configuration . EnvironmentName = "Production" ;
1329
14- Err . ReportLogicError ( "User should have been assigned." ) ;
1530 try
1631 {
17- throw new NotSupportedException ( "Not invented here ") ;
32+ throw new InvalidOperationException ( "Hello ") ;
1833 }
1934 catch ( Exception ex )
2035 {
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, "jonas@gauffin.com", "This is what I did: NOTHING!");
39+
40+ Err . Report ( ex , new { userId = 10 , ErrTags = "console" } ) ;
2241 }
42+
43+ Err . ReportLogicError ( "User should have been assigned." , errorId : "MainN" ) ;
44+
45+ ThrowImportantError ( ) ;
2346 Console . WriteLine ( "Hello World!" ) ;
2447 }
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+ }
2569 }
2670}
0 commit comments