if (err.status !== undefined) {
const errorMessage = this.buildServerErrorMessage(err)
- logger.error(`Backend returned code ${err.status}, errorMessage is: ${errorMessage}`)
+
+ const message = `Backend returned code ${err.status}, errorMessage is: ${errorMessage}`
+
+ if (err.status === HttpStatusCode.NOT_FOUND_404) logger.clientError(message)
+ else logger.error(message)
return errorMessage
}
warn (message: LoggerMessage, meta?: LoggerMeta) {
this.runHooks('warn', message, meta)
+ this.clientWarn(message, meta)
+ }
+
+ clientWarn (message: LoggerMessage, meta?: LoggerMeta) {
if (meta) console.warn(message, meta)
else console.warn(message)
}
error (message: LoggerMessage, meta?: LoggerMeta) {
this.runHooks('error', message, meta)
+ this.clientError(message, meta)
+ }
+
+ clientError (message: LoggerMessage, meta?: LoggerMeta) {
if (meta) console.error(message, meta)
else console.error(message)
}