Welcome Guest, Not a member yet? Register   Sign In
Exceptions exceptions...
#3

(This post was last modified: 04-19-2020, 05:00 PM by Gary.)

Hey Leo,

I suspect simply checking if $e is that particularly type of exception inside your catch block, and then returning your Flashdata message if it is (look in \system\\CodeIgniter\Images\Exceptions\ImageException.php for all of the CI system image exception types), and also follow this check with a rethrow of the exception if it's not of your Images.unsupportedImageCreate exception... may work.

Depending on how you've done your validation, I suspect you could also push a message into the validation error array (instead of using Flashdata), so that it'll show up like any of the other- more automated- existing validation checks using something like this:

Code:
$validation->setError('field_name_where_error_will_show', 'custom_message_and_user_insults_here');    // see \system\Validation\Validation.php for setError() details
Reply


Messages In This Thread
Exceptions exceptions... - by Gary - 04-17-2020, 07:07 AM
RE: Exceptions exceptions... - by Leo - 04-19-2020, 02:08 PM
RE: Exceptions exceptions... - by Gary - 04-19-2020, 04:20 PM
RE: Exceptions exceptions... - by Leo - 04-20-2020, 12:12 AM
RE: Exceptions exceptions... - by Gary - 04-20-2020, 02:56 AM
RE: Exceptions exceptions... - by Leo - 04-20-2020, 06:05 AM
RE: Exceptions exceptions... - by Gary - 04-20-2020, 06:52 AM
RE: Exceptions exceptions... - by Leo - 04-20-2020, 10:31 AM
RE: Exceptions exceptions... - by Gary - 04-20-2020, 01:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB