error: Error,
params: HandleErrorParams<T> = { throwError: true, consoleOut: false }
): T | undefined {
- setDefaultErrorParams(params)
+ params = setDefaultErrorParams(params)
logger.error(
`${chargingStation.logPrefix()} ${moduleName}.handleIncomingRequestError: Incoming request command '${commandName}' error:`,
error
)
+ console.error('params set', params)
if (params.throwError === false && params.errorResponse != null) {
return params.errorResponse
}
consoleOut: false
}
): void {
- setDefaultErrorParams(params, { throwError: false, consoleOut: false })
+ params = setDefaultErrorParams(params, { throwError: false, consoleOut: false })
const inTableOrCollectionStr = table != null && ` in table or collection '${table}'`
logger.error(
`${this.logPrefix} ${this.getDBNameFromStorageType(type)} error '${
logPrefix: string,
params: HandleErrorParams<EmptyObject> = defaultErrorParams
): void => {
- setDefaultErrorParams(params)
+ params = setDefaultErrorParams(params)
const prefix = isNotEmptyString(logPrefix) ? `${logPrefix} ` : ''
let logMsg: string
switch (error.code) {
consoleOut: false
}
): void => {
- setDefaultErrorParams(params, { throwError: false, consoleOut: false })
+ params = setDefaultErrorParams(params, { throwError: false, consoleOut: false })
logger.error(
`${chargingStation.logPrefix()} Send ${getMessageTypeString(messageType)} command '${commandName}' error:`,
error
params: HandleErrorParams<T>,
defaultParams: HandleErrorParams<T> = defaultErrorParams
): HandleErrorParams<T> => {
- params = { ...defaultParams, ...params }
- return params
+ return { ...defaultParams, ...params }
}