//
//  SORIError.h
//  SORI
//
//  Created by Heeseung Seo on 2017. 8. 31..
//  Copyright © 2017년 iPlateia. All rights reserved.
//

#import <Foundation/Foundation.h>

/// Definitions of SORI error codes
typedef NS_ENUM(NSInteger, SORIErrorCode) {
    SORIErrorCodeNone = 0,
    SORIErrorCodeBeginInterruption = 100,
    SORIErrorCodeFinishInterruption = 101,
    SORIErrorCodeNetworkNotReachable = 400,
    SORIErrorCodeAuthenticationFailure = 401,
    SORIErrorCodeAudioRecordDenied = 402,
    SORIErrorCodeServerError = 500,
    SORIErrorCodeAudioServiceFailure = 501,
    SORIErrorCodeFileOperationFailure = 502,
    SORIErrorCodeInvalidResponses = 503,
    SORIErrorCodeFailedToDownloadAudiopacks = 504,
};

/// This class describes errors generated by SORI Framework
@interface SORIError : NSObject

+ (SORIError * _Nonnull)shared;

+ (NSNotificationName _Nonnull)errorNotificationName;
+ (NSErrorDomain _Nonnull)errorDomain;
+ (NSError * _Nonnull)errorWithErrorCode:(SORIErrorCode)code;
+ (NSError * _Nonnull)errorWithErrorCode:(SORIErrorCode)code description:(NSString * _Nonnull)description;
+ (void)postErrorNotificationWithErrorCode:(SORIErrorCode)code;
+ (void)postErrorNotificationWithErrorCode:(SORIErrorCode)code reason:(NSString * _Nullable)reason;

@end
