feat(server): implemented getChartTracks api; feat(server): added some error helpers

This commit is contained in:
Roberto Tonino
2021-04-24 21:53:24 +02:00
parent 4919c8d698
commit 2433209676
4 changed files with 53 additions and 1 deletions

View 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

View File

@@ -0,0 +1 @@
export const isObjectEmpy = (obj: any) => Object.keys(obj).length === 0