# TCGBError Class Reference

Inherits from | NSError
Declared in | TCGBError.h TCGBError.m

## Overview

TCGBError class represents a result of some APIs or an occurred error.

## Other Methods

### `+ resultWithCode:`

Creates TCGBError instance.

`+ (TCGBError *)resultWithCode:(NSInteger)code`

#### Parameters

`code` | error code

#### Declared In

`TCGBError.h`

### `+ resultWithCode:message:`

Creates TCGBError instance.

`+ (TCGBError *)resultWithCode:(NSInteger)code message:(NSString *)message`

#### Parameters

`code` | error code.
`message` | error message.

#### Declared In

`TCGBError.h`

### `+ resultWithDomain:code:userInfo:`

Creates TCGBError instance.

`+ (TCGBError *)resultWithDomain:(NSString *)domain code:(NSInteger)code userInfo:(NSDictionary<NSErrorUserInfoKey,id> *)userInfo`

#### Parameters

`domain` | error domain.
`code` | error code.
`userInfo` | a dictionary with userInfo.

#### Declared In

`TCGBError.h`

### `+ resultWithDomain:code:description:underlyingError:`

Create TCGBError instance. If the description value is nil or empty string, it will be set a value to default error message.

`+ (TCGBError *)resultWithDomain:(NSString *)domain code:(NSInteger)code description:(NSString *)description underlyingError:(NSError *)underlyingError`

#### Parameters

`domain` | domain error domain.
`code` | error code.
`description` | description about error. If it’s value is set to nil or empty.
`underlyingError` | error object what a cause of error.

#### Declared In

`TCGBError.h`

### `– message`

Error message

`- (NSString *)message`

#### Declared In

`TCGBError.h`

### `– jsonString`

JSON string

`- (NSString *)jsonString`

#### Declared In

`TCGBError.h`

### `– prettyJsonString`

Pretty JSON string

`- (NSString *)prettyJsonString`

#### Declared In

`TCGBError.h`

### `– detailError`

DetailError using underlyingError

`- (NSError *)detailError`

#### Declared In

`TCGBError.h`

### `– detailErrorCode`

DetailError error code using underlyingError

`- (NSInteger)detailErrorCode`

#### Discussion

If the detailed error code does not exist, kTCGBDetailErrorNotExist is returned.

#### Declared In

`TCGBError.h`

### `– detailErrorDomain`

DetailError error domain using underlyingError

`- (NSString *)detailErrorDomain`

#### Declared In

`TCGBError.h`

### `– detailErrorMessage`

DetailError error message using underlyingError

`- (NSString *)detailErrorMessage`

#### Declared In

`TCGBError.h`

### `– exceptionId`

Error UUID

`- (nullable NSString *)exceptionId`

#### Declared In

`TCGBError.h`

## Extension Methods

### `uuid`

Error UUID

`@property (nonatomic, readwrite, strong) NSString *uuid`

#### Declared In

`TCGBError.m`