When the InvalidArgumentException is throw at you, it would be nice if it includes the path so you can debug ?
Labels |
Added:
J3 Issue
|
You could only show if debug mode is on
Exception messages shouldn't change based on whether debug mode is enabled.
You can try/catch this particular exception and log the path if need be as you'll have the path data where you're catching the exception, it doesn't really need to be part of the message.
If the image path really needs to be part of the Exception object, a custom subclass should be added with a $path
property that can be accessed when catching and processing exceptions, similar to how we have custom exceptions for database level errors where the query is a property on the class and not stuffed into the message. Personally, I don't think we need this.
So long and short, the data you need is already there, you just need to add some additional error handling to your code to catch and handle this error instead of letting it bubble up past a point where the path info would be accessible.
Why is not finding an image an exception at all anway ?
The two uses of that specific message are in the Image
class. In both cases, it requires the image file to do what is being instructed. Failing to load that file is correctly an exception.
Status | New | ⇒ | Information Required |
@basd82 can this Issue be closed?
yes
Met vriendelijke groet,
Bas van den Dikkenberg
Van: Franz Wohlkönig notifications@github.com
Verzonden: maandag 4 maart 2019 19:05
Aan: joomla/joomla-cms joomla-cms@noreply.github.com
CC: Bas van den DIkkenberg bas@dikkenberg.net; Mention mention@noreply.github.com
Onderwerp: Re: [joomla/joomla-cms] throw new \InvalidArgumentException('The image file does not exist.'); (#22550)
@basd82 https://github.com/basd82 can this Issue be closed?
This comment was created with the J!Tracker Application https://github.com/joomla/jissues at issues.joomla.org/tracker/joomla-cms/22550 https://issues.joomla.org/tracker/joomla-cms/22550 .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #22550 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/ABKceWocUz2fKQIg2dNuWwYaWHqeqROmks5vTWBLgaJpZM4XMs1t .
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-04 18:49:11 |
Closed_By | ⇒ | franz-wohlkoenig |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-04 18:49:11 |
Closed_By | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/22550
closed as stated above, thanks @basd82
This could lead to an information disclosure you may not want.