You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-14Lines changed: 24 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,34 +8,44 @@ to add an error description, enrich logs with error code, context data, collect
8
8
9
9
### What is an error code?
10
10
11
-
An error code is a number (or a combination of letters and numbers) that corresponds to a specific problem in the operation of the program.
12
-
Example of error code: SSTV.10321, where SSTV is the prefix of app or [bounded context](https://martinfowler.com/bliki/BoundedContext.html).
11
+
An error code is a number (or a combination of letters and numbers) that corresponds to a specific problem in the
12
+
operation of the program.
13
+
Example of error code: SSTV10321, where SSTV is the prefix of app
14
+
or [bounded context](https://martinfowler.com/bliki/BoundedContext.html).
15
+
13
16
### Purpose
14
17
15
18
Applications often encounter exceptions and developers usually spend too little time to do exceptions properly.
16
-
Exceptions can help us to notify about error, stop processing and avoid potentially corrupting data, provide some context to it for further research and fix.
17
-
If we designate all the code with unique error codes, it will be faster to determine the root of the problem when it arises.
18
-
When user occurs some error, we can show error code to him, and provide link to the helpful wiki page or user documentation for this error code, Using so user can fix the problem by himself or share it to the technical support.
19
-
Technical support can look his own wiki, find article by error code, read the solution or recommendations how to solve the problem or avoid this concrete error, and maybe do automatical scripts and help to user. Error codes can save a lot of time in investigation problems.
19
+
Exceptions can help us to notify about error, stop processing and avoid potentially corrupting data, provide some
20
+
context to it for further research and fix.
21
+
If we designate all the code with unique error codes, it will be faster to determine the root of the problem when it
22
+
arises.
23
+
When user occurs some error, we can show error code to him, and provide link to the helpful wiki page or user
24
+
documentation for this error code, Using so user can fix the problem by himself or share it to the technical support.
25
+
Technical support can look his own wiki, find article by error code, read the solution or recommendations how to solve
26
+
the problem or avoid this concrete error, and maybe do automatical scripts and help to user. Error codes can save a lot
|[Sstv.DomainExceptions](./Sstv.DomainExceptions/README.md)|[](https://www.nuget.org/packages/Sstv.DomainExceptions)| Core lib with no dependencies, that can be referenced in your domain layer |
28
-
|[Sstv.DomainExceptions.Extensions.DependencyInjection](./Sstv.DomainExceptions.Extensions.DependencyInjection/README.md)|[](https://www.nuget.org/packages/Sstv.DomainExceptions.Extensions.DependencyInjection)| Dependency injection integration lib, for configuring at composition root |
|[Sstv.DomainExceptions](./Sstv.DomainExceptions/README.md)|[](https://www.nuget.org/packages/Sstv.DomainExceptions)| Core lib with no dependencies, that can be referenced in your domain layer |
36
+
|[Sstv.DomainExceptions.Extensions.DependencyInjection](./Sstv.DomainExceptions.Extensions.DependencyInjection/README.md)|[](https://www.nuget.org/packages/Sstv.DomainExceptions.Extensions.DependencyInjection)| Dependency injection integration lib, for configuring at composition root |
How to install and use, you can read at theirs readme files.
32
40
33
41
For usage example, you can look the sample [here](./Sstv.Host).
34
42
35
43
Sample also use [Hellang.Middleware.ProblemDetails](https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails/),
36
-
that very easy to automatically convert response into [ProblemDetails](https://datatracker.ietf.org/doc/html/rfc7807) format.
37
-
We can switch to [IExceptionHandler](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-5/#iexceptionhandler) for the same purpose,
38
-
when .NET 8 ships in November 2023.
44
+
that very easy to automatically convert response into [ProblemDetails](https://datatracker.ietf.org/doc/html/rfc7807)
0 commit comments