}
const handleSendError = (ocppError: OCPPError): void => {
- if (params?.skipBufferingOnError === false) {
+ if (params.skipBufferingOnError === false) {
// Buffer
chargingStation.bufferMessage(messageToSend)
if (messageType === MessageType.CALL_MESSAGE) {
)
}
} else if (
- params?.skipBufferingOnError === true &&
+ params.skipBufferingOnError === true &&
messageType === MessageType.CALL_MESSAGE
) {
// Remove request from the cache
`Timeout ${formatDurationMilliSeconds(
OCPPConstants.OCPP_WEBSOCKET_TIMEOUT
)} reached for ${
- params?.skipBufferingOnError === false ? '' : 'non '
+ params.skipBufferingOnError === false ? '' : 'non '
}buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
(messagePayload as OCPPError).details
new OCPPError(
ErrorType.GENERIC_ERROR,
`WebSocket errored for ${
- params?.skipBufferingOnError === false ? '' : 'non '
+ params.skipBufferingOnError === false ? '' : 'non '
}buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
{ name: error.name, message: error.message, stack: error.stack }
new OCPPError(
ErrorType.GENERIC_ERROR,
`WebSocket closed for ${
- params?.skipBufferingOnError === false ? '' : 'non '
+ params.skipBufferingOnError === false ? '' : 'non '
}buffered message id '${messageId}' with content '${messageToSend}'`,
commandName,
(messagePayload as OCPPError).details