> For the complete documentation index, see [llms.txt](https://obsrv.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://obsrv.sunbird.org/guides/connectors-developer-guide/classes/errordata-class.md).

# ErrorData Class

### Overview

The `ErrorData` case class is a part of the `org.sunbird.obsrv.job.model.Models` package. It encapsulates error information, including an error code and an error message, which can be used to provide detailed error reporting and handling within the application.

### Class Definition

```scala
package org.sunbird.obsrv.job.model.Models

import com.fasterxml.jackson.annotation.JsonProperty

case class ErrorData(
  @JsonProperty("error_code") errorCode: String,
  @JsonProperty("error_msg") errorMsg: String
)
```

### Fields

#### `errorCode: String`

* **Description**: The unique code representing the specific error.
* **Annotations**: `@JsonProperty("error_code")`

#### `errorMsg: String`

* **Description**: A descriptive message providing details about the error.
* **Annotations**: `@JsonProperty("error_msg")`

### Usage

The `ErrorData` case class is used to encapsulate error information that can be serialized and deserialized to and from JSON. It provides a structured way to represent errors in the application.

#### Example

```scala
import org.sunbird.obsrv.job.model.Models.ErrorData

val error = ErrorData(
  errorCode = "404",
  errorMsg = "Resource not found"
)

// Accessing error fields
println(s"Error Code: ${error.errorCode}")
println(s"Error Message: ${error.errorMsg}")
```

### JSON Representation

An instance of `ErrorData` can be serialized to JSON as follows:

```json
{
  "error_code": "404",
  "error_msg": "Resource not found"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://obsrv.sunbird.org/guides/connectors-developer-guide/classes/errordata-class.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
