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

Task fails with ambiguous error on JSON file that has comments #74

Open
1 of 2 tasks
norvegec opened this issue Jun 30, 2020 · 1 comment
Open
1 of 2 tasks

Task fails with ambiguous error on JSON file that has comments #74

norvegec opened this issue Jun 30, 2020 · 1 comment

Comments

@norvegec
Copy link

norvegec commented Jun 30, 2020

Before opening an issue please read this.

Are you reporting a bug or a feature request ?

  • Bug
  • Feature request

Description

When JSON content of input file has comments the task fails with ambiguous message:

##[error]Couldn't apply patch to file: C:\myTargetDir\_configs\appsettings.dev.json
##[error]No files were patched.

Expected behavior

  • Good: output an error that would clearly point to a problem: "malformed JSON content" or "unsupported JSON content at line XXX", etc.
  • Better: ignore comments in JSON

Reproduction

Add this task (ver. 3/4) to a pipeline that works with filesystem (Azure Pipeline Windows 2019 agent pool) with options:

  • Syntax type: Slick Syntax,
  • Target files: appsettings.$(env).json
  • Patch content:
  • Output patched file in logs: checked
  • Fail if no files are patched: checked

and taking into account that file actually exist
the task logs ambiguous error:

##[error]Couldn't apply patch to file: C:\myTargetDir\_configs\appsettings.dev.json
##[error]No files were patched."

# System information

**VSTS or TFS:**
* [x] VSTS
* [ ] TFS

**Agent:**
* [x] Hosted
* [ ] Custom

**OS:**
* [x] Windows
* [ ] Mac
* [ ] Linux


@norvegec
Copy link
Author

Since then, I've discovered that JSON5 format is supported and works fine when corresponding option is checked. Maybe an error could give user a hint to use this flag?

@norvegec norvegec changed the title Fails with ambiguous error on JSON file that has comments Task fails with ambiguous error on JSON file that has comments Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant