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

improved exception on generation failure #321

Merged
merged 2 commits into from
Feb 7, 2014

Conversation

digitalkaoz
Copy link
Contributor

include the requested image in exception message when the generation failed

$image = $this->dataManager->find($filter, $path);
$response = $this->filterManager->get($request, $filter, $image, $path);
} catch (RuntimeException $e) {
throw new RuntimeException('unable to create image for '.$path.' error was: '.$e->getMessage(), 0, $e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you catching an exception and throwing the very same exception (with different content)? There is no use to this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i catch and rethrow to get the requested file in my logging. E.g. the PROD logs wont show the faulty image, only that someting went wrong, now you have the requested file in your logs, and can investigate furher

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I understand the request, but you have the URL where the exception was raised?

I'm not against this, if it helps, I'm fine. But the exception being thrown by this bundle has to be changed. It's not valid to throw an exception of a different vendor, that's what the previous is for.

<?php

throw new \RuntimeException(sprintf('Unable to create image for path "%s" and filter "%s".', $path, $filter), 0, $e);

@havvg havvg added this to the v0.18.x milestone Feb 7, 2014
@havvg havvg added the Chore label Feb 7, 2014
@digitalkaoz
Copy link
Contributor Author

ok fixed it

havvg added a commit that referenced this pull request Feb 7, 2014
improved exception on generation failure
@havvg havvg merged commit 6aeebad into liip:master Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attn: Critical This issue or PR is critical and should be rushed into a new release ASAP.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants