We have a front-end form that allows users to update their profile photo. If a user attempts to upload a non-image file, instead of the actionSaveUser controller failing and throwing an error, it gets to $this->_processUserPhoto and then throws an Exception
{
200 // Invalid SVG. Maybe it's missing its DTD?
201 $svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.$svg;
202 $this->_image = $this->_instance->load($svg);
203 }
204 }
205 else
206 {
207 $imageInfo = @getimagesize($path);
208
209 if (!is_array($imageInfo))
210 {
211 throw new Exception(Craft::t('The file “{path}” does not appear to be an image.', array('path' => $path)));
212 }
Is there a more graceful way to handle this so I can return an error to the user instead?