Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ready Marjan Nikolovski Father, Dev, CEO/Emit Knowledge Down the rabbit hole Error handling examined try { } // // Blog: emitknowledge.com/research-labs.

Similar presentations


Presentation on theme: "Ready Marjan Nikolovski Father, Dev, CEO/Emit Knowledge Down the rabbit hole Error handling examined try { } // // Blog: emitknowledge.com/research-labs."— Presentation transcript:

1 Ready Marjan Nikolovski Father, Dev, CEO/Emit Knowledge Down the rabbit hole Error handling examined try { } // Twitter: @m4rjann // Blog: emitknowledge.com/research-labs

2 Ready

3 Agenda Error theory; Error types; Handling error per type; Responsible sides; Error handling strategies; Error handling for business logic; Error handling for client; Error handling for web applications; Log analytics;

4 Ready ERROR IS AN ANY INTERUPTION THAT STOPS THE SYSTEM TO EXECUTE A BUSINESS CONTEXT

5 Ready A system must have a good strategy when it comes to error handling Most of the code in a solution is trying to handle different types of errors and exceptions It is easy to specify and write code to make the system operable. Hard times come when trying to predict what can go wrong

6 Ready Bugs, issues we can’t predict nor control. Ex: Stackoverflow, Nullpointer... Error types using System; class Program { static void Main() { User appUser = DomainServices.User.GetByUsername(@“marjann”); Console.WriteLine(appUser.Email); }

7 Ready Error from invalid input. Ex: We expect integer value, the user enters some random characters... Error types using System; class Program { static void Main() { var userIdInput = Console.ReadLine(); int id = int.Parse(userIdInput); Console.WriteLine(id); }

8 Ready Infrastructural problems. Ex: Missing write permissions on server, full disk, DB not available... Error types using System; class Program { static void Main() { var user = UserRepository.GetByUsername(@”marjann”); Console.WriteLine(user.Email); }

9 Ready Bugs are system problems that we can’t handle unless we apply a patch. So what types of errors we can handle? Invalid data entry is a system problem that we can handle proactively. If we have infrastructural problems, the system should be able to notify the system administrators.

10 Ready End clients who are using the system. Responsible sides System administrators. Software developers.

11 Ready Software developers. Who should handle the bugs?

12 Ready Global – architectural decision on system level. Error handling strategies Local-contextual – handling errors in a process/method/action.

13 Ready ERROR HANDLING Web/Mobile/DeviceREST APISERVICES BUSINESS LOGIC DATA REPOSITORYEXTERNAL SERVICES

14 Ready Global perspective of the system. GLOBAL STRATEGY Centralized error handling. We want detailed error instead of wrapped exception. We want execution details. We want unified error messages.

15 Ready GLOBAL STRATEGY Internally, a system should not hide the exceptions. Ex: User.IsExistingUsername(“marjann”) -> DbConnetionException != false Externally, a system should always be transparent and should support unified error information when an error occurs. Ex: Invalid username, Username is not valid!?

16 Ready Say hello to the local context. What if we can retry? Use local context as an exception to the rule! We can’t predict and handle all of the errors, but we must keep the system alive. Exception to the rule: If it does not work fake it!

17 Ready Unification of errors, codes and groups. Error handling for business logic Information about an error(Error Info) against Exceptions. Enrich an error with data for logging aspect.

18 Ready Demo

19 Ready Be transparent and show enough information to the end user. Error handling for client

20 Ready Demo

21 Ready Error message localization. Error handling for web applications Transferring error information back to the app.

22 Ready Demo

23 Ready Who, What, How, Where, When? Log analytics PROM – tool for process mining. We should be able to answer: - How our system is used? - Where our system perform slow? - Parameters of execution? - Patterns of execution?

24 Ready

25 catch(PPTException up){ } Logger.Log(“QUESTIONS?”, up); throw up;


Download ppt "Ready Marjan Nikolovski Father, Dev, CEO/Emit Knowledge Down the rabbit hole Error handling examined try { } // // Blog: emitknowledge.com/research-labs."

Similar presentations


Ads by Google