J3 Issue ?
avatar basd82
basd82
8 Oct 2018

When the InvalidArgumentException is throw at you, it would be nice if it includes the path so you can debug ?

avatar basd82 basd82 - open - 8 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Oct 2018
avatar brianteeman brianteeman - change - 9 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 9 Oct 2018
avatar HLeithner
HLeithner - comment - 10 Oct 2018

This could lead to an information disclosure you may not want.

avatar basd82
basd82 - comment - 10 Oct 2018

You could only show if debug mode is on

avatar mbabker
mbabker - comment - 10 Oct 2018

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.

avatar basd82
basd82 - comment - 10 Oct 2018

Why is not finding an image an exception at all anway ?

avatar mbabker
mbabker - comment - 10 Oct 2018

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.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

@basd82 can this Issue be closed?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22550.

avatar basd82
basd82 - comment - 4 Mar 2019

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 .

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-04 18:49:11
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-04 18:49:11
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 4 Mar 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

closed as stated above, thanks @basd82


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22550.

Add a Comment

Login with GitHub to post a comment