[eluser]Mat-Moo[/eluser]
I'm working on a small image library and I'm playing with method chaining. This is my first time of writing method chaining and I understand the principal, but not sure on how to handle errors.
Code:
$lib->load_image("x")->resize(200,200);
Pretty simple, load_image should return $this, but what if the file was not found? Do I just set my error internally and you check after?
Code:
$lib->load_image("x")->resize(200,200);
if ($lib->error) print $lib->display_errors();
Is that the correct way to handle it? I don't want to just kill the script!