-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnotification.errors.js
More file actions
145 lines (132 loc) · 3.48 KB
/
notification.errors.js
File metadata and controls
145 lines (132 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import { BaseError } from './BaseError.js';
export class NotificationNotFoundError extends BaseError {
constructor(data = null) {
super({
errorCode: "N001",
reason: "알림을 찾을 수 없습니다",
statusCode: 404,
data
});
}
}
export class NotificationPermissionDeniedError extends BaseError {
constructor(data = null) {
super({
errorCode: "N002",
reason: "알림에 접근할 권한이 없습니다",
statusCode: 403,
data
});
}
}
export class AlreadyReadNotificationError extends BaseError {
constructor(data = null) {
super({
errorCode: "N003",
reason: "이미 읽은 알림입니다",
statusCode: 400,
data
});
}
}
export class NotificationSendFailedError extends BaseError {
constructor(data = null) {
super({
errorCode: "N004",
reason: "알림 발송에 실패했습니다",
statusCode: 500,
data
});
}
}
export class NoUnreadNotificationsError extends BaseError {
constructor(data = null) {
super({
errorCode: "N005",
reason: "읽지 않은 알림이 없습니다",
statusCode: 400,
data
});
}
}
export class NoNotificationsToDeleteError extends BaseError {
constructor(data = null) {
super({
errorCode: "N006",
reason: "삭제할 알림이 없습니다",
statusCode: 400,
data
});
}
}
export class NoNotificationsSelectedError extends BaseError {
constructor(data = null) {
super({
errorCode: "N007",
reason: "삭제할 알림을 선택해주세요",
statusCode: 400,
data
});
}
}
// 특정 사용자의 FCM 토큰을 찾는데 없는 경우
export class PushTokenNotFoundError extends BaseError {
constructor(data = null) {
super({
errorCode: "N008",
reason: "등록된 FCM 토큰이 없습니다",
statusCode: 404,
data
});
}
}
export class PushTokenInvalidError extends BaseError {
constructor(data = null) {
super({
errorCode: "N009",
reason: "FCM 토큰이 비어있거나 유효하지 않습니다",
statusCode: 400,
data
});
}
}
export class FCMSendFailedError extends BaseError {
constructor(data = null) {
super({
errorCode: "N010",
reason: "FCM Push 알림 발송에 실패했습니다",
statusCode: 500,
data
});
}
}
export class PushTokenAlreadyExistsError extends BaseError {
constructor(data = null) {
super({
errorCode: "N011",
reason: "이미 등록된 FCM 토큰입니다",
statusCode: 409,
data
});
}
}
export class NotificationIdRequiredError extends BaseError {
constructor(data = null) {
super({
errorCode: "N012",
reason: "notificationId가 필요합니다",
statusCode: 400,
data
});
}
}
export class TargetUserIdRequiredError extends BaseError {
constructor(data = null) {
super({
errorCode: "N013",
reason: "target_user_id가 필요합니다",
statusCode: 400,
data
});
}
}