node icon indicating copy to clipboard operation
node copied to clipboard

ambiguous error

Open tanner0101 opened this issue 7 years ago • 2 comments

Code

try json.get("permissions") as [String]

Input

{
	"userId": "xxx"
}

Error

{
  "debugReason": "No value found at path '', expected 'String'",
  "error": true,
  "identifier": "Node.NodeError.unableToConvert",
  "possibleCauses": [
    "typo in key path",
    "underlying type is not convertible",
    "unexpected '.' being interpreted as path instead of key"
  ],
  "reason": "Internal Server Error",
  "suggestedFixes": [
    "called `get(...)` on a key or key path that does not exist in the data",
    "the data being parsed is missing required values or is incorrectly formatted",
    "found unconvertible data, e.g., got a string of letters when an integer is required",
    "if you have keys containing a '.' that shouldn't be interpreted as a path, use 'DotKey(\"actual.key\")'"
  ]
}

tanner0101 avatar Mar 21 '17 17:03 tanner0101

Yeah, I just lost an hour hunting down what was causing this problem. I had renamed a key on the server side, but forgot to update the parameter name in the Rested app. Sure wish this error gave you the specific key that caused the error.

ThuggishNuggets avatar Jul 31 '17 02:07 ThuggishNuggets

@ThuggishNuggets that's something we're working on in the next version. Updating this issue to reflect that.

tanner0101 avatar Aug 07 '17 17:08 tanner0101