Interface IAppErrorService
Provides methods to manage application errors.
Namespace: DataWeb.Error
Assembly: DataWeb.Core.dll
Syntax
public interface IAppErrorService
Methods
GetErrorAsync(string, CancellationToken)
Retrieves an error with the specified Id asynchronously.
Declaration
Task<AppError> GetErrorAsync(string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The Id of the error to retrieve. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<AppError> | An AppError object if found, otherwise null. |
GetErrorsAsync(CancellationToken)
Retrieves all errors asynchronously.
Declaration
Task<IEnumerable<AppError>> GetErrorsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<AppError>> | A collection of AppError objects. |
GetErrorsCountAsync(CancellationToken)
Retrieves the count of all errors asynchronously.
Declaration
Task<long> GetErrorsCountAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | The count of all errors. |
RemoveAllAsync(CancellationToken)
Removes all errors asynchronously.
Declaration
Task RemoveAllAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SetEntryAsync(string, string, string, string, CancellationToken)
Sets a new error log entry asynchronously.
Declaration
Task SetEntryAsync(string errorMessage, string errorStackTrace = null, string errorUrl = null, string userIdMaster = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | errorMessage | The error message to log. |
string | errorStackTrace | The stack trace of the error (optional). |
string | errorUrl | The URL where the error occurred (optional). |
string | userIdMaster | The Id of the user associated with the error (optional). |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |