feat(server): implemented getChartTracks api; feat(server): added some error helpers
This commit is contained in:
11
server/src/helpers/errors.ts
Normal file
11
server/src/helpers/errors.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export const logError = (console: any) => (errorText: string) => console.error(`[deemix-server]: ${errorText}`)
|
||||
export const consoleError = logError(console)
|
||||
|
||||
export class BadRequestError extends Error {
|
||||
constructor() {
|
||||
super()
|
||||
this.message = 'Bad request!'
|
||||
}
|
||||
}
|
||||
|
||||
export const isBadRequestError = (error: any) => error instanceof BadRequestError
|
||||
1
server/src/helpers/primitive-checks.ts
Normal file
1
server/src/helpers/primitive-checks.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const isObjectEmpy = (obj: any) => Object.keys(obj).length === 0
|
||||
Reference in New Issue
Block a user