# Basic Usage

## Creating an Enhanced Error Object

Here's a simple example demonstrating how to create an enhanced error object:

```typescript
import { ErrorEnhanced, IdentifiersEnhancer, Severity } from 'error-enhanced';

// Instantiate a new enhanced error object
const error = new ErrorEnhanced([
  new IdentifiersEnhancer()
]);
```

## Setting Properties

You can set various properties like the error code and severity level:

```typescript
error
  .setErrorCode(404)
  .setSeverity(Severity.HIGH);
```

## Accessing Properties

You can easily retrieve the properties you've set:

```typescript
console.log(error.id);  // Outputs a unique identifier for the error
console.log(error.severity);  // Outputs the severity level, e.g., "HIGH"
```

***


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://labrynx.gitbook.io/error-enhanced/basic-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
