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

Output verbose exception msg on separate line #46

Merged
merged 1 commit into from Mar 6, 2020

Conversation

@johannessteu
Copy link
Contributor

johannessteu commented Mar 5, 2020

This change outputs the exception message on a worker in verbose mode on a seperate line. This allows parsing json data on console output.

This change outputs the exception message on a worker in verbose mode on a seperate line. This allows parsing json data on console output.
Copy link
Contributor

bwaidelich left a comment

That change doesn't hurt – unless someone already parsed the current format and re-used that. Which I wouldn't suggest to do for that very reason: It's very fragile.

Instead I would suggest you just invoke the job queue "manually" wherever you need to parse the result into JSON. The CommandController is just a very thin abstraction over the API anyways, it's just a few lines to replicate this:

            try {
                $message = $this->jobManager->waitAndExecute($queue, $timeout);
            } catch (JobQueueException $exception) {
                // Deal with exception and turn it into JSON?!
            }
@johannessteu

This comment has been minimized.

Copy link
Contributor Author

johannessteu commented Mar 5, 2020

Jip. What we actually do is to use this https://github.com/t3n/flowlog#consolestorage . So each Exception is logged to the stdout right now. Due to the current implementation it will always be prefixed and the json is invalid. A custom command controller would be easy to implement for sure, but we'd had to add it to a lot of projects/places and is more ore less only a duplicate

@daniellienert daniellienert merged commit e65861e into Flowpack:master Mar 6, 2020
@johannessteu johannessteu deleted the johannessteu:patch-1 branch Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.