Skip to content

Commit 0a83f5f

Browse files
committed
refact: error naming changes
1 parent a12dbda commit 0a83f5f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

errors/errorHandler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
export class MissingParamError extends Error {
22
constructor(param : string) {
33
super(`Missing param : ${param}`)
4-
this.name = "Missing Parameter Error"
4+
this.name = "MissingParamError"
55
}
66
}
77

88
export class CollectionNotFoundError extends Error {
99
constructor(collection : string) {
1010
super(`Collection ${collection} was not found in database`)
11-
this.name = "Collection Not Found"
11+
this.name = "CollectionNotFoundError"
1212
}
1313
}
1414

1515

1616
export class DatabaseError extends Error {
1717
constructor(err : string) {
1818
super(err)
19-
this.name = "Database Error"
19+
this.name = "DatabaseError"
2020
}
2121
}
2222

2323
export class NotFoundError extends Error {
2424
constructor(err : string) {
2525
super(err)
26-
this.name = "Not Found Error"
26+
this.name = "NotFoundError"
2727
}
2828
}
2929

3030
export class DuplicationError extends Error {
3131
constructor(err? : string){
3232
super(err || "Duplication error occured")
33-
this.name = "Duplication error"
33+
this.name = "DuplicationError"
3434
}
3535
}
3636

3737
export class CreateFileError extends Error {
3838
constructor(err? : string){
3939
super(err || "Failed to create database.json")
40-
this.name = "CreateFile Error"
40+
this.name = "CreateFileError"
4141
}
4242

4343
}

0 commit comments

Comments
 (0)