credmark.cmf.model.errors.ModelDataErrorDTO

DTO class ModelDataErrorDTO(*, type, message, stack=[], code='generic', detail=None, permanent=False)[source]

Bases: ModelErrorDTO

An error that occurs during the lookup, generation, or processing of data this is considered deterministic and permanent, in the sense that for the given context, the same error will always occur.

Show JSON schema
{
   "title": "ModelDataErrorDTO",
   "description": "An error that occurs during the lookup, generation, or\nprocessing of data this is considered deterministic and\npermanent, in the sense that for the given context, the\nsame error will always occur.",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "description": "Error type",
         "type": "string"
      },
      "message": {
         "title": "Message",
         "description": "Error message",
         "type": "string"
      },
      "stack": {
         "title": "Stack",
         "description": "Model call stack. Last element is the model that raised the error.",
         "default": [],
         "type": "array",
         "items": {
            "$ref": "#/definitions/ModelCallStackEntry"
         }
      },
      "code": {
         "title": "Code",
         "description": "Short identifier for the type of error",
         "default": "generic",
         "type": "string"
      },
      "detail": {
         "title": "Detail",
         "description": "Arbitrary data object related to the error."
      },
      "permanent": {
         "title": "Permanent",
         "description": "If true, the error will always give the same result for the same context.",
         "default": false,
         "type": "boolean"
      }
   },
   "required": [
      "type",
      "message",
      "stack",
      "code",
      "permanent"
   ],
   "definitions": {
      "ModelCallStackEntry": {
         "title": "ModelCallStackEntry",
         "description": "An item in an error's call stack.",
         "type": "object",
         "properties": {
            "slug": {
               "title": "Slug",
               "description": "Model slug",
               "type": "string"
            },
            "version": {
               "title": "Version",
               "description": "Model version",
               "type": "string"
            },
            "chainId": {
               "title": "Chainid",
               "description": "Context chain id",
               "type": "integer"
            },
            "blockNumber": {
               "title": "Blocknumber",
               "description": "Context block number",
               "type": "integer"
            },
            "input": {
               "title": "Input",
               "description": "Context input"
            },
            "trace": {
               "title": "Trace",
               "description": "Trace of code that generated the error",
               "type": "string"
            }
         },
         "required": [
            "slug",
            "version"
         ]
      }
   }
}

Fields
Parameters
Return type

None

field code: str = 'generic'

Short identifier for the type of error

field detail: Union[DetailDTOClass, None] = None

Arbitrary data object related to the error.

field message: str [Required]

Error message

field permanent: bool = False

If true, the error will always give the same result for the same context.

field stack: List[ModelCallStackEntry] = []

Model call stack. Last element is the model that raised the error.

field type: str [Required]

Ex. ‘ModelDataError’, ‘ModelRunError’, ‘ModelInputError’

Error type

classmethod schema(by_alias=None, ref_template=None)