# TCGBError Class Reference

Inherits from | NSError
Declared in | TCGBError.h

## Overview

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

## Initialization

### `+ 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:(nullable 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:(nullable NSString *)description underlyingError:(nullable 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`

## Properties

### `– message`

Error message

`- (NSString *)message`

#### Declared In

`TCGBError.h`

### `– prettyJsonString`

Pretty JSON string

`- (NSString *)prettyJsonString`

#### Declared In

`TCGBError.h`

### `– jsonString`

JSON string

`- (NSString *)jsonString`

#### Declared In

`TCGBError.h`

### `– detailError`

DetailError using underlyingError

`- (nullable 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

`- (nullable NSString *)detailErrorDomain`

#### Declared In

`TCGBError.h`

### `– detailErrorMessage`

DetailError error message using underlyingError

`- (nullable NSString *)detailErrorMessage`

#### Declared In

`TCGBError.h`

### `– exceptionId`

Error UUID

`- (nullable NSString *)exceptionId`

#### Declared In

`TCGBError.h`