Skip to content

TypeError: Cannot read properties of undefined (reading 'length') on batch request #55

@mikhail-g

Description

@mikhail-g

TypeError: Cannot read properties of undefined (reading 'length')

        at Request._callback (/Users/Mykhailo_Hariachyi/dev/coxa/dcpnc-admin-tool/node_modules/rally/dist/request.js:117:31)
        at Request.self.callback (/Users/Mykhailo_Hariachyi/dev/coxa/dcpnc-admin-tool/node_modules/request/request.js:185:22)
        at Request.<anonymous> (/Users/Mykhailo_Hariachyi/dev/coxa/dcpnc-admin-tool/node_modules/request/request.js:1154:10)
        at Gunzip.<anonymous> (/Users/Mykhailo_Hariachyi/dev/coxa/dcpnc-admin-tool/node_modules/request/request.js:1076:12)

when sending request to /batch

The Result is an array in this case and does not have Errors field:

{
  "Results": [...]
}

Fix: add a question mark at lib/request.js line 75
if (result.Errors?.length) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions