BBAException.h
654 Bytes
//
// BBAException.h
// BBAFoundation
//
// Created by Yunpeng Li on 2020/1/14.
// Copyright © 2020 Baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#define BBAThrow(EXCEPTION_NAME, REASON, ...) [BBAException throw:(EXCEPTION_NAME) reason: ([NSString stringWithFormat: REASON, ##__VA_ARGS__])]
@interface BBAException : NSObject
/**
* @brief Debug/线下环境下抛出异常 (当BBAFoundationDebugs组件存在时即会抛出异常)
*
* @param name 异常名称
* @param reason 产生异常的原因
*/
+ (void)throw:(NSExceptionName)name reason:(nullable NSString *)reason;
@end
NS_ASSUME_NONNULL_END