Skip to content

CLI object deserialization #828

@Klynk

Description

@Klynk

Describe the bug
The CLI is not deserializing objects when printing them, making it difficult to debug / troubleshoot.
I tested this in both CMD and PowerShell, both producing the same output.

To Reproduce
Trigger any error by uploading / building faulty package.
smartthings edge:drivers:package

Expected behavior
According to this link here: https://developer.smartthings.com/docs/connected-services/troubleshooting/
Expected error message should print child objects instead of just [Object] in the error property:

{
  "requestId": "031fec1a-f19f-470a-a7da-710569082846"
  "error": {
    "code": "ConstraintViolationError",
    "message": "Validation errors occurred while process your request.",
    "details": [
      { "code": "PatternError", "target": "latitude", "message": "Invalid format." },
      { "code": "SizeError", "target": "name", "message": "Too small." },
      { "code": "SizeError", "target": "description", "message": "Too big." }
    ]
  }
}

Actual behavior

      Symbol(kChunkedBuffer): [],
      Symbol(kChunkedLength): 0,
      Symbol(kSocket): [TLSSocket],
      Symbol(kOutHeaders): [Object: null prototype],
      Symbol(errored): null,
      Symbol(kHighWaterMark): 16384,
      Symbol(kRejectNonStandardBodyWrites): false,
      Symbol(kUniqueHeaders): null
    },
    data: { requestId: '69c517670000000077206272847588ce', error: [Object] } // <------ problematic line
  },
  status: 500

Additional context
Installer: MSI
OS: Windows 11
Version: 2.1.1 (was also problematic in last version I tested 2.0.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions