Documentation Cloud4.ai
HomeCloud ConsoleDiscord Community
  • 🌟Cloud4.ai Documentation
  • Introduction
    • Overview
    • Security
    • 💸Pricing
    • 😀Commission to Model Developers
    • Backlog
    • Enterprise
  • SDK
    • 🚩Quick Start
    • 🔐Authentication
    • ⚙️Configurations & Env Variables
    • ⭐Request
      • Execution Options
      • Execution Schedule
    • 🔗Response
    • 🔶Commands
    • 🟥Errors
  • Concept
    • Organization Structure
    • C4AI Command
    • SIC (Service Identity Code)
    • .cc4
    • 📕Glossary
  • Services
    • General Information
    • 🟨EES (Elastic Endpoint)
      • 🔶EES Commands
      • Use Cases
    • 🟨CSS Credentials Store
      • Best Practices
    • 🟨AAC (AI API Connector)
      • AAC Commands
    • 🟨AIL (AI Lambda)
    • 🟨CES (Chain Execution)
    • 🟨API Schema
    • 🟨KDB (Knowledgebase)
      • KDB Commands
    • 🟨CDB (Context Data Storage)
    • 🟨PL (Prompt Library)
      • PL Commands
    • 🟨PLPrompt (Prompt)
      • Prompt Commands
    • 🟨IDR (Intellectual Data Retrieval)
    • 🟨IDTS (Intellectual Data Transformation Service)
    • 🟨IDOS (Intellectual Data Observation Service)
    • 🟨Files
    • 🟨SJS (Scheduled Job Service )
Powered by GitBook
On this page
  • C4AI_SDK_Error
  • Usage
  • Parameters
  • Methods

Was this helpful?

  1. SDK

Errors

C4AI_SDK_Error


The C4AI_SDK_Error class is designed to handle errors and exceptions within the Cloud4.ai SDK. It provides a unified structure for identifying and processing errors, ensuring consistency and reliability in error handling across different parts of the SDK.

Usage

To use the C4AI_SDK_Error class, import it into your project from the Cloud4.ai SDK and initialize it with the appropriate parameters. Here's an example of how to use the class:

import { C4AI_SDK_Error } from '@c4ai-sdk/global/C4AISDKError.class';

const error = new C4AI_SDK_Error({
    name: 'EXECUTOR_SIC_MISSING',
    message: 'Executor SIC is missing',
    code: 'C4AI_SDK_EES_00001',
    description: 'Executor SIC is missing in the request. Please make sure you have provided the sic in the request.',
    link: 'https://docs.cloud4.ai/ees/executor-sic'
});

Parameters

Parameter
Description

name

The name of the error.

message

The error message.

code

The error code associated with the error.

description

A detailed description of the error.

link

(optional) A link to additional documentation or resources related to the error.

Methods

  • toJSON(): Returns a JSON representation of the error object, including all parameters.

PreviousCommandsNextOrganization Structure

Last updated 1 year ago

Was this helpful?

🟥