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.
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?
if ($lib->error) print $lib->display_errors();
Is that the correct way to handle it? I don’t want to just kill the script!