NIMSDK-iOS
载入中...
搜索中...
未找到
NIMDatabaseException.h
浏览该文件的文档.
1//
2// NIMDatabaseException.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright © 2022 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
12
13NS_ASSUME_NONNULL_BEGIN
14
15/**
16 * 数据库异常类型
17 */
18typedef NS_ENUM(NSInteger, NIMDatabaseExceptionType)
19{
20 /**
21 * 损坏的DB
22 * @deprecated 请使用 NIMDatabaseExceptionTypeCorrupt
23 */
25
26 /**
27 * 未分类的通用错误
28 */
30
31 /**
32 * 数据库损坏
33 */
35
36 /**
37 * 磁盘空间已满
38 */
40};
41
42/**
43 * 数据库异常处理协议
44 */
45@protocol NIMDatabaseHandleExceptionProtocol <NSObject>
46
47@optional
48
49/**
50 * 数据库异常处理方法
51 */
52- (void)handleException:(NIMDatabaseException *)exception;
53
54@end
55
56/**
57 * 数据库异常信息
58 */
59@interface NIMDatabaseException : NSObject
60
61/**
62 * 异常
63 */
64@property (nonatomic,assign,readonly) NIMDatabaseExceptionType exception;
65
66/**
67 * 数据库异常信息
68 */
69@property (nullable,nonatomic,copy,readonly) NSString *message;
70
71/**
72 * 数据库文件沙盒路径
73 */
74@property (nullable,nonatomic,copy,readonly) NSString *databasePath;
75
76/**
77 * 注册数据库异常处理对象
78 * @param handler 用户自定义处理对象
79 */
80+ (void)registerExceptionHandler:(id<NIMDatabaseHandleExceptionProtocol>)handler;
81
82@end
83
84NS_ASSUME_NONNULL_END
NIMDatabaseExceptionType
Definition: NIMDatabaseException.h:19
@ NIMDatabaseExceptionTypeBadDb
Definition: NIMDatabaseException.h:24
@ NIMDatabaseExceptionTypeGeneric
Definition: NIMDatabaseException.h:29
@ NIMDatabaseExceptionTypeCorrupt
Definition: NIMDatabaseException.h:34
@ NIMDatabaseExceptionTypeFull
Definition: NIMDatabaseException.h:39
Definition: NIMDatabaseException.h:60
NSString * message
Definition: NIMDatabaseException.h:69
NIMDatabaseExceptionType exception
Definition: NIMDatabaseException.h:64
NSString * databasePath
Definition: NIMDatabaseException.h:74