Inherits from NSObject
Declared in NGLError.h

Overview

The NinevehGL Error API.

NGLError stores the last error generated by NinevehGL processing and later show the error on the console panel.

Every error instance has two elements:

  • A header;
  • A message.

The header is not taken as an error, it’s more like a generic information. Changing the header doesn’t generate any error. On the other hand, the message represents a real new error. At every change in the message a new error is generated and a property indicates that there is an unshown error waiting to appear.

When the error is shown at the console panel, that property returns to null state indicating there is no error waiting to be showed.

Tasks

  •   hasError

    Indicates if there is a non-shown error in this NGLError instance.

    property
  •   hadError

    Indicates if this class had at least one valid error.

    property
  •   header

    The message that will be displayed in the error’s header. Setting the header is not considered the creation of a new error.

    property
  •   message

    The message that describes the error. Setting the message automatically creates a new error, but it does not show it yet.

    property
  • – initWithHeader:

    Initiates an error class with a header in it.

  • – showError

    Commits the error and shows it on the console panel.

  • + error

    Returns an autorelease instance of NGLError.

  • + errorWithHeader:

    Returns an autorelease instance of NGLError with a header in it.

  • + errorWithHeader:andMessage:

    Returns an autorelease instance of NGLError with an error message in it.

  • + errorInstantlyWithHeader:andMessage:

    Generates an error instantly at the console panel.

Properties

hadError

Indicates if this class had at least one valid error.

@property (nonatomic, readonly) BOOL hadError

Discussion

Indicates if this class had at least one valid error.

Declared In

NGLError.h

hasError

Indicates if there is a non-shown error in this NGLError instance.

@property (nonatomic, readonly) BOOL hasError

Discussion

Indicates if there is a non-shown error in this NGLError instance.

Declared In

NGLError.h

header

The message that will be displayed in the error’s header. Setting the header is not considered the creation of a new error.

@property (nonatomic, copy) NSString *header

Discussion

The message that will be displayed in the error’s header. Setting the header is not considered the creation of a new error.

Declared In

NGLError.h

message

The message that describes the error. Setting the message automatically creates a new error, but it does not show it yet.

@property (nonatomic, copy) NSString *message

Discussion

The message that describes the error. Setting the message automatically creates a new error, but it does not show it yet.

Declared In

NGLError.h

Class Methods

error

Returns an autorelease instance of NGLError.

+ (id)error

Return Value

A NGLError autoreleased instance.

Discussion

Returns an autorelease instance of NGLError.

This creates a new empty instance of NGLError.

Declared In

NGLError.h

errorInstantlyWithHeader:andMessage:

Generates an error instantly at the console panel.

+ (void)errorInstantlyWithHeader:(NSString *)headerString andMessage:(NSString *)messageString

Parameters

headerString

A NSString containing the header to this error instance.

messageString

A NSString containing the message to this error instance.

Return Value

A NGLError autoreleased instance.

Discussion

Generates an error instantly at the console panel.

This method doesn’t return an autoreleased instance, instead it will automatically generates an error at the console panel based on a header and a message.

Declared In

NGLError.h

errorWithHeader:

Returns an autorelease instance of NGLError with a header in it.

+ (id)errorWithHeader:(NSString *)headerString

Parameters

headerString

A NSString containing the header to this error instance.

Return Value

A NGLError autoreleased instance.

Discussion

Returns an autorelease instance of NGLError with a header in it.

This creates a new instance of NGLError and puts a header in it. Although this new instance will have a header, it will have no error message.

Declared In

NGLError.h

errorWithHeader:andMessage:

Returns an autorelease instance of NGLError with an error message in it.

+ (id)errorWithHeader:(NSString *)headerString andMessage:(NSString *)messageString

Parameters

headerString

A NSString containing the header to this error instance.

messageString

A NSString containing the message to this error instance.

Return Value

A NGLError autoreleased instance.

Discussion

Returns an autorelease instance of NGLError with an error message in it.

This creates a new instance of NGLError with a header and a message in it. As the error message is considered a true error, this instance will be ready to show the error at the console panel.

Declared In

NGLError.h

Instance Methods

initWithHeader:

Initiates an error class with a header in it.

- (id)initWithHeader:(NSString *)header

Parameters

header

A NSString containing the header content.

Return Value

A new initialized instance.

Discussion

Initiates an error class with a header in it.

This method initializes an error instance and set a header. The header is not considered an error and can be changed at any time.

Declared In

NGLError.h

showError

Commits the error and shows it on the console panel.

- (void)showError

Discussion

Commits the error and shows it on the console panel.

The error will be displayed using the header and message strings, with a line break between them.

Declared In

NGLError.h