New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kafkajs

Package Overview
Dependencies
Maintainers
2
Versions
299
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kafkajs - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

7

CHANGELOG.md

@@ -8,2 +8,9 @@ # Changelog

## [0.6.1] - 2017-12-08
### Added
- Add latest Kafka error codes
### Fixed
- Add fallback error for unsupported error codes
## [0.6.0] - 2017-12-07

@@ -10,0 +17,0 @@ ### Added

2

package.json
{
"name": "kafkajs",
"version": "0.6.0",
"version": "0.6.1",
"description": "A modern Apache Kafka client for node.js",

@@ -5,0 +5,0 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>",

@@ -281,8 +281,118 @@ const { KafkaJSProtocolError } = require('../errors')

},
{
type: 'OUT_OF_ORDER_SEQUENCE_NUMBER',
code: 45,
retriable: false,
message: 'The broker received an out of order sequence number',
},
{
type: 'DUPLICATE_SEQUENCE_NUMBER',
code: 46,
retriable: false,
message: 'The broker received a duplicate sequence number',
},
{
type: 'INVALID_PRODUCER_EPOCH',
code: 47,
retriable: false,
message:
"Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker",
},
{
type: 'INVALID_TXN_STATE',
code: 48,
retriable: false,
message: 'The producer attempted a transactional operation in an invalid state',
},
{
type: 'INVALID_PRODUCER_ID_MAPPING',
code: 49,
retriable: false,
message:
'The producer attempted to use a producer id which is not currently assigned to its transactional id',
},
{
type: 'INVALID_TRANSACTION_TIMEOUT',
code: 50,
retriable: false,
message:
'The transaction timeout is larger than the maximum value allowed by the broker (as configured by max.transaction.timeout.ms)',
},
{
type: 'CONCURRENT_TRANSACTIONS',
code: 51,
retriable: false,
message:
'The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing',
},
{
type: 'TRANSACTION_COORDINATOR_FENCED',
code: 52,
retriable: false,
message:
'Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer',
},
{
type: 'TRANSACTIONAL_ID_AUTHORIZATION_FAILED',
code: 53,
retriable: false,
message: 'Transactional Id authorization failed',
},
{
type: 'SECURITY_DISABLED',
code: 54,
retriable: false,
message: 'Security features are disabled',
},
{
type: 'OPERATION_NOT_ATTEMPTED',
code: 55,
retriable: false,
message:
'The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest',
},
{
type: 'KAFKA_STORAGE_ERROR',
code: 56,
retriable: true,
message: 'Disk error when trying to access log file on the disk',
},
{
type: 'LOG_DIR_NOT_FOUND',
code: 57,
retriable: false,
message: 'The user-specified log directory is not found in the broker config',
},
{
type: 'SASL_AUTHENTICATION_FAILED',
code: 58,
retriable: false,
message: 'False SASL Authentication failed',
},
{
type: 'UNKNOWN_PRODUCER_ID',
code: 59,
retriable: false,
message:
"This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer's records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer's metadata is removed from the broker, and future appends by the producer will return this exception",
},
{
type: 'REASSIGNMENT_IN_PROGRESS',
code: 60,
retriable: false,
message: 'A partition reassignment is in progress',
},
]
const unknownErrorCode = errorCode => ({
type: 'KAFKAJS_UNKNOWN_ERROR_CODE',
code: -99,
retriable: false,
message: `Unknown error code ${errorCode}`,
})
const SUCCESS_CODE = 0
const failure = code => code !== SUCCESS_CODE
const createErrorFromCode = code => {
return new KafkaJSProtocolError(errorCodes.find(e => e.code === code))
return new KafkaJSProtocolError(errorCodes.find(e => e.code === code) || unknownErrorCode(code))
}

@@ -289,0 +399,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc