Class ExtractorError
Utility type for reporting errors to integrations.
After creation you should immediately either Dispose,
call Finish, or call Instant.
Typically created through utility methods on IErrorReporter
Implements
Inherited Members
Namespace: Cognite.Extractor.Utils.Unstable.Tasks
Assembly: ExtractorUtils.dll
Syntax
public class ExtractorError : IDisposable
  Constructors
| Edit this page View SourceExtractorError(ErrorLevel, string, IIntegrationSink, string?, string?, DateTime?)
Create a new extractor error.
Declaration
public ExtractorError(ErrorLevel level, string description, IIntegrationSink sink, string? details = null, string? taskName = null, DateTime? now = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ErrorLevel | level | Error level.  | 
      
| string | description | Short error description.  | 
      
| IIntegrationSink | sink | Error sink this is written to.  | 
      
| string | details | Long error details.  | 
      
| string | taskName | Task that generated this error. If left out, the error is assigned to the extractor itself.  | 
      
| DateTime? | now | Current time, for synchronization. Defaults to DateTime.UtcNow  | 
      
Properties
| Edit this page View SourceDescription
Short error description.
Declaration
public string Description { get; }
  Property Value
| Type | Description | 
|---|---|
| string | 
Details
Long error details.
Declaration
public string? Details { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | 
EndTime
Time the error ended, if it has ended yet.
Declaration
public DateTime? EndTime { get; }
  Property Value
| Type | Description | 
|---|---|
| DateTime? | 
ExternalId
Generated error external ID.
Declaration
public string ExternalId { get; }
  Property Value
| Type | Description | 
|---|---|
| string | 
Level
Error level.
Declaration
public ErrorLevel Level { get; }
  Property Value
| Type | Description | 
|---|---|
| ErrorLevel | 
StartTime
Time the error started.
Declaration
public DateTime StartTime { get; }
  Property Value
| Type | Description | 
|---|---|
| DateTime | 
TaskName
Task that generated this error.
If left out, the error is assigned to the extractor itself.
Declaration
public string? TaskName { get; }
  Property Value
| Type | Description | 
|---|---|
| string | 
Methods
| Edit this page View SourceDispose()
Dispose the error, just calls Finish.
Declaration
public void Dispose()
  Dispose(bool)
Dispose the error, just calls Finish.
Declaration
protected virtual void Dispose(bool disposing)
  Parameters
| Type | Name | Description | 
|---|---|---|
| bool | disposing | 
Finish(DateTime?)
Mark this error as completed and report it.
Declaration
public void Finish(DateTime? now = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DateTime? | now | Current time, for synchronization. Defaults to DateTime.UtcNow  | 
      
Instant()
Immediately mark this error as completed.
Declaration
public ExtractorError Instant()
  Returns
| Type | Description | 
|---|---|
| ExtractorError | 
ToSdk()
Return an ErrorWithTask for writing to the integrations API.
Declaration
public ErrorWithTask ToSdk()
  Returns
| Type | Description | 
|---|---|
| ErrorWithTask | ErrorWithTask object  |