> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/BintzGavin/helios/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Error handling utilities for Helios

## HeliosError

Custom error class for all Helios-specific errors.

```typescript theme={null}
export class HeliosError extends Error {
  public readonly code: HeliosErrorCode;
  public readonly suggestion?: string;

  constructor(code: HeliosErrorCode, message: string, suggestion?: string)
}
```

<ParamField path="code" type="HeliosErrorCode" required>
  Error code identifying the specific error type
</ParamField>

<ParamField path="message" type="string" required>
  Human-readable error message
</ParamField>

<ParamField path="suggestion" type="string">
  Optional suggestion for resolving the error
</ParamField>

### Properties

<ResponseField name="code" type="HeliosErrorCode">
  The error code identifying the specific error type
</ResponseField>

<ResponseField name="suggestion" type="string | undefined">
  Optional suggestion for resolving the error
</ResponseField>

### Static methods

#### isHeliosError

Type guard to check if an unknown error is a HeliosError.

```typescript theme={null}
static isHeliosError(error: unknown): error is HeliosError
```

<ParamField path="error" type="unknown" required>
  Error to check
</ParamField>

<ResponseField name="return" type="boolean">
  True if the error is a HeliosError instance
</ResponseField>

### Example

```typescript theme={null}
import { HeliosError, HeliosErrorCode } from '@helios-project/core';

try {
  // Some operation that might fail
  throw new HeliosError(
    HeliosErrorCode.INVALID_FPS,
    'FPS must be greater than 0',
    'Use a positive number for fps'
  );
} catch (error) {
  if (HeliosError.isHeliosError(error)) {
    console.error(`Error [${error.code}]: ${error.message}`);
    if (error.suggestion) {
      console.log(`Suggestion: ${error.suggestion}`);
    }
  }
}
```

## HeliosErrorCode

Enumeration of all possible error codes in Helios.

```typescript theme={null}
enum HeliosErrorCode {
  INVALID_DURATION = 'INVALID_DURATION',
  INVALID_FPS = 'INVALID_FPS',
  INVALID_PLAYBACK_RANGE = 'INVALID_PLAYBACK_RANGE',
  INVALID_INPUT_RANGE = 'INVALID_INPUT_RANGE',
  INVALID_OUTPUT_RANGE = 'INVALID_OUTPUT_RANGE',
  UNSORTED_INPUT_RANGE = 'UNSORTED_INPUT_RANGE',
  INVALID_SPRING_CONFIG = 'INVALID_SPRING_CONFIG',
  INVALID_SRT_FORMAT = 'INVALID_SRT_FORMAT',
  INVALID_WEBVTT_FORMAT = 'INVALID_WEBVTT_FORMAT',
  INVALID_INPUT_PROPS = 'INVALID_INPUT_PROPS',
  INVALID_RESOLUTION = 'INVALID_RESOLUTION',
  INVALID_COLOR_FORMAT = 'INVALID_COLOR_FORMAT',
  INVALID_TIMECODE_FORMAT = 'INVALID_TIMECODE_FORMAT',
  INVALID_MARKER = 'INVALID_MARKER',
  MARKER_NOT_FOUND = 'MARKER_NOT_FOUND',
  INVALID_SCHEMA = 'INVALID_SCHEMA'
}
```

### Error codes

<ResponseField name="INVALID_DURATION">
  Duration value is invalid or out of acceptable range
</ResponseField>

<ResponseField name="INVALID_FPS">
  Frames per second value is invalid (e.g., zero or negative)
</ResponseField>

<ResponseField name="INVALID_PLAYBACK_RANGE">
  Playback range is invalid or malformed
</ResponseField>

<ResponseField name="INVALID_INPUT_RANGE">
  Input range for interpolation is invalid
</ResponseField>

<ResponseField name="INVALID_OUTPUT_RANGE">
  Output range for interpolation is invalid
</ResponseField>

<ResponseField name="UNSORTED_INPUT_RANGE">
  Input range values are not in strictly ascending order
</ResponseField>

<ResponseField name="INVALID_SPRING_CONFIG">
  Spring animation configuration is invalid
</ResponseField>

<ResponseField name="INVALID_SRT_FORMAT">
  SRT subtitle format is malformed
</ResponseField>

<ResponseField name="INVALID_WEBVTT_FORMAT">
  WebVTT subtitle format is malformed
</ResponseField>

<ResponseField name="INVALID_INPUT_PROPS">
  Component input props failed validation
</ResponseField>

<ResponseField name="INVALID_RESOLUTION">
  Resolution value is invalid
</ResponseField>

<ResponseField name="INVALID_COLOR_FORMAT">
  Color string format is not recognized
</ResponseField>

<ResponseField name="INVALID_TIMECODE_FORMAT">
  Timecode format does not match HH:MM:SS:FF
</ResponseField>

<ResponseField name="INVALID_MARKER">
  Marker definition is invalid
</ResponseField>

<ResponseField name="MARKER_NOT_FOUND">
  Requested marker does not exist
</ResponseField>

<ResponseField name="INVALID_SCHEMA">
  Schema definition is invalid or malformed
</ResponseField>
