-
Notifications
You must be signed in to change notification settings - Fork 379
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
improve error message #192
Comments
I don't see any use case for an empty path on this route. |
You won't even get this exception in production environment using SE config because the requirement check does not take place then. It instead will generate such a route with empty path anyway. |
hm, but then is it better if we silently ignore the issue or throw an |
@Tobion Are you sure on this? It sounds scary and wrong to me, I'm not using SE config, which option is it that enables this behavior? |
Well, found it myself; |
I would suggest to result in a 404 if the path is empty. A better solution would be to add an event to resolve this 404 if the user likes to, e.g. fallback image on filter_set basis. |
so we actually would change the route path requirements to .* instead of |
Well this check is only disabled for generating urls for performance reasons, not for matching. So a wrongly generated url would result in 404 anyway (unless another route matches). |
Ah, that makes more sense. Then I would stick with the first solution, to make the exception more readable (in case path is empty), so no invalid URL is generated. |
moving to 1.1 milestone as 0.20 is not supported any more. |
Does this still make sense for you @dbu ? |
lets drop it :-) |
when i manage to pass an empty path into the imagine_filter twig function (e.g. i have a phpcr
Image
document that is null). now instead of getting some message like "Invalid image source" i get "An exception has been thrown during the rendering of a template ("Parameter "path" for route "_imagine_home_slideshow" must match ".+" ("" given) to generate a corresponding URL.")"the last step is in CacheManager::generateUrl - is it sane to assume there that if the path is empty we do have a problem? or are there use cases where path can legally be empty?
i am happy to do a PR for this, but wanted to ask first if it makes sense at all.
The text was updated successfully, but these errors were encountered: