Skip to content

cmem_client.models.error¤

Error response models for Corporate Memory API error handling.

This module defines models for parsing and handling error responses from both the DataIntegration (build) and DataPlatform (explore) APIs. Different API endpoints return different error response formats, and these models provide a unified way to handle them.

The Problem model handles DataPlatform API errors, while ErrorResult handles DataIntegration API errors. Both include methods for generating human-readable error messages for debugging and user feedback.

Classes:

  • ErrorResult – An error result, communicated by the server
  • ErrorResultIssue – An issue listed with an ErrorResult
  • Problem – A problem, communicated by the server
  • Violation – A data violation, communicated with a problem

ErrorResult¤

Bases: Model

An error result, communicated by the server

returned by the build APIs (DataIntegration)

Attributes:

  • title (str) – Short summary of the error.
  • detail (str) – Longer explanation of this particular occurrence.
  • issues (list[ErrorResultIssue] | None) – The single issues behind the error, if the endpoint reports them. An import which failed on several tasks lists one issue per task.

detail¤

detail: str

issues¤

issues: list[ErrorResultIssue] | None = None

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

title¤

title: str

ErrorResultIssue¤

Bases: Model

An issue listed with an ErrorResult

Attributes:

  • type (Literal[‘Error’, ‘Warning’, ‘Info’]) – Severity of the issue. Only Error means the operation failed.
  • message (str) – What the issue is.
  • id (str) – ID of the task or item the issue belongs to.

id¤

id: str

message¤

message: str

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

type¤

type: Literal['Error', 'Warning', 'Info']

Problem¤

Bases: Model

A problem, communicated by the server

This type of response is returned by the explore APIs (DataPlatform)

Attributes:

  • type (str) – URI identifying the kind of problem.
  • title (str) – Short summary of the problem.
  • status (int) – HTTP status code the response carried.
  • details (str) – Longer explanation of this particular occurrence.
  • violations (list[Violation]) – The rejected fields, for a problem caused by invalid input.

Functions:

details¤

details: str = Field(default='')

get_exception_message¤

get_exception_message()

Get error message

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

status¤

status: int

title¤

title: str

type¤

type: str

violations¤

violations: list[Violation] = Field(default=[])

Violation¤

Bases: Model

A data violation, communicated with a problem

Attributes:

  • field (str) – Name of the field which was rejected.
  • message (str) – What is wrong with it.

field¤

field: str

message¤

message: str

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

Comments