Skip to content

Improve error reporting when action fail to parse correctly the payload #359

@cedric-appdirect

Description

@cedric-appdirect

Description

In case of a payload parse error, we get the message Invalid input! Failed to parse contents of the provided payload. which is not very specific. It would be great to have a better message that highlight which line is the source of the error.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

When the payload is malformed, it result in a parse error message which does not guide us on where to look for to find the problem. It would be great if we could at least have the line where the first error happen.

Reproducible in:

package version: latest

node version:

OS version(s):

Steps to reproduce:

  1. Send a malformed payload
  2. Figure out why it is malformed

Expected result:

Display the line of the first error found. I understand there is a difficulty with the optimistic detection of the file format (yaml vs json), but it is likely that a yaml file parse with less error when there is a malformed payload with the yaml parser than with the json parser.

Actual result:

Just say: Invalid input! Failed to parse contents of the provided payload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-triage-skipPrevent this issue from being closed due to lack of activityenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions