Sunbird Obsrv
  • Introduction
    • The Value of Data
    • Data Value Chain
    • Challenges
    • The Solution: Obsrv
  • Core Concepts
    • Obsrv Overview
    • Key Capabilities
    • Datasets
    • Connectors
    • High Level Architecture
    • Tech Stack
    • Monitoring
  • Explore
    • Roadmap
    • Case Studies
      • Agri Climate Advisory
      • Learning Analytics at Population Scale
      • IOT Observations Infra
      • Data Driven Features in Learning Platform
      • Network Observability
      • Fraud Detection
    • Performance Benchmarks
  • Guides
    • Installation
      • AWS Installation Guide
      • Azure Installation Guide
      • GCP Installation Guide
      • OCI Installation Guide
      • Data Center Installation Guide
    • Dataset Management APIs
    • Dataset Management Console
    • Connector APIs
    • Data In & Out APIs
    • Alerts and Notification Channels APIs
    • Developer Guide
    • Example Datasets
    • Connectors Developer Guide
      • SDK Assumptions
      • Required Files
        • metadata.json
        • ui-config.json
        • metrics.yaml
        • alerts.yaml
      • Obsrv Base Setup
      • Dev Requirements
      • Interfaces
        • Stream Interfaces
        • Batch Interfaces
      • Classes
        • ConnectorContext Class
        • ConnectorStats Class
        • ConnectorState Class
        • ErrorData Class
        • MetricData Class
      • Verifying
      • Packaging Guide
      • Reference Implementations
    • Coming Soon!
  • Community
  • Previous Versions
    • SB-5.0 Version
      • Overview
      • USE
        • Release Notes
          • Obsrv 2.0-Beta
          • Obsrv 2.1.0
          • Obsrv 2.2.0
          • Obsrv 2.0.0-GA
          • Obsrv 5.3.0-GA
          • Release V 5.1.0
          • Release V 5.1.2
          • Release V 5.1.3
          • Release V 5.0.0
          • Release V 4.10.0
        • Installation Guide
        • Obsrv 2.0 Installation Guide
          • Getting Started with Obsrv Deployment Using Helm
        • System Requirements
      • LEARN
        • Functional Capabilities
        • Dependencies
        • Product Roadmap
        • Product & Developer Guide
          • Telemetry Service
          • Data Pipeline
          • Data Service
          • Data Product
            • On Demand Druid Exhaust Job
              • Component Diagram
              • ML CSV Reports
              • Folder Struture
          • Report Service
          • Report Configurator
          • Summarisers
      • ENGAGE
        • Discuss
        • Contribute to Obsrv
      • Raise an Issue
  • Release Notes
    • Obsrv 1.1.0 Beta Release
    • Obsrv 1.2.0-RC Release
Powered by GitBook
On this page
  • Overview
  • Class Definition
  • Fields
  • Usage
  • JSON Representation

Was this helpful?

Edit on GitHub
  1. Guides
  2. Connectors Developer Guide
  3. Classes

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

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

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:

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

PreviousConnectorState ClassNextMetricData Class

Last updated 5 months ago

Was this helpful?