clarin.sru.diagnostic

class clarin.sru.diagnostic.SRUDiagnostic(uri: str, details: str | None = None, message: str | None = None)[source]

Bases: object

Class to hold a SRU diagnostic.

uri: str

Diagnostic’s identifying URI.

details: str | None = None

Supplementary information available, often in a format specified by the diagnostic or None.

message: str | None = None

Human readable message to display to the end user or None.

static get_default_error_message(uri: str)[source]
class clarin.sru.diagnostic.SRUDiagnosticList[source]

Bases: object

Container for non surrogate diagnostics for the request. The will be put in the diagnostics part of the response.

abstract add_diagnostic(uri: str, details: str | None = None, message: str | None = None) None[source]

Add a non surrogate diagnostic to the response.

Parameters:
  • uri – the diagnostic’s identifying URI

  • details – supplementary information available, often in a format specified by the diagnostic or None

  • message – human readable message to display to the end user or None