Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure details from certain Salesforce CLI commands are trapped in stack data inside of the CLI's JSON response #117

Open
VivekMChawla opened this issue Feb 2, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@VivekMChawla
Copy link
Contributor

When the Salesforce CLI command force:data:tree:import fails, detailed failure information appears as a string representation of JSON data inside of the CLI's JSON response.

This output looks like this when the error details are shown to the user after the falcon:adk:install command fails:

image

If this data was parsed as an additional JSON object, it could be displayed to the user as something like this:

{
  "hasErrors": true,
  "results": [
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef3",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef5",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef7",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef8",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef9",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef10",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef11",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef12",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef13",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef14",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef15",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef16",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef17",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef18",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef19",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef20",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef21",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef22",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef23",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef24",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef25",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef26",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef27",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef28",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef29",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef30",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef35",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef38",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef41",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef44",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef47",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    },
    {
      "referenceId": "FinServ__RollupByLookupConfig__cRef48",
      "errors": [
        {
          "statusCode": "FIELD_CUSTOM_VALIDATION_EXCEPTION",
          "message": "You've reached the maximum of 50 active configuration items.",
          "fields": [
            
          ]
        }
      ]
    }
  ]
}

I would like to find a way to identify encapsulated JSON and pull it out for better display to the user.

@VivekMChawla VivekMChawla added the bug Something isn't working label Feb 2, 2019
@VivekMChawla VivekMChawla self-assigned this Feb 2, 2019
VivekMChawla added a commit that referenced this issue Feb 3, 2019
Sometimes when a CLI command gets a failed response from Salesforce, the
JSON response from the server is NOT sent to the "result" key in the
JSON that's returned by the CLI. Instead, it gets embedded as part of
the "stack" key and needs to be extracted.

Related to: #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant