Skip to content

Always parse flyway -outputType=json CLI output from stdout, never stderr (#1) - #52

Open
bhamiltoncx wants to merge 1 commit into
domdinnes:masterfrom
terraware:fix-41
Open

bhamiltoncx wants to merge 1 commit into
domdinnes:masterfrom
terraware:fix-41

Conversation

@bhamiltoncx

Copy link
Copy Markdown

From the flyway docs:

Add -outputType=json to the argument list to print JSON instead of human-readable output. Errors are included in the JSON payload instead of being sent to stderr.

On failure, node-flyway currently always tries to parse JSON from stderr, but flyway -outputType=json always writes its errors (as JSON) to stdout. This causes #41 .

This fixes the issue by always parsing stdout, regardless of whether or not the process exits successfully.

Fixes #41 .

…derr (#1)

From [the flyway docs](https://github.com/flyway/flywaydb.org/blob/gh-pages/documentation/usage/commandline/index.md#machine-readable-output):

> Add -outputType=json to the argument list to print JSON instead of human-readable output. Errors are included in the JSON payload instead of being sent to stderr.

On failure, `node-flyway` currently always tries to parse JSON from `stderr`, but `flyway -outputType=json` always writes its errors (as JSON) to `stdout`. This causes domdinnes#41 .

This fixes the issue by always parsing `stdout`, regardless of whether or not the process exits successfully.
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

Successfully merging this pull request may close these issues.

convertJsonToResponse error when array property value is undefined

1 participant