forked from ChatPlug/libfb-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Errors.ts
37 lines (37 loc) · 798 Bytes
/
Errors.ts
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
export class AuthAPIError extends Error {
code?: number
errorData?: any
requestArgs?: any
}
export class UploadAPIError extends Error {
debugInfo: {
retriable: boolean
type: string
message: string
}
constructor (debugInfo) {
super('Error occured while uploading')
this.debugInfo = debugInfo
}
}
export class APIError extends Error {
details: any
constructor (status, details) {
super(status)
this.details = details
}
}
export class AttachmentNotFoundError extends Error {
path: string
constructor (path) {
super('Attachment not found!')
this.path = path
}
}
export class AttachmentURLMissingError extends Error {
attachment: any
constructor (attachment) {
super('Attachment URL missing!')
this.attachment = attachment
}
}