CodeIgniter Forums
Graceful error messages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Graceful error messages (/showthread.php?tid=2995)



Graceful error messages - El Forum - 09-03-2007

[eluser]stevefink[/eluser]
Folks,

Is there anyway I can do something to eliminate hard errors such as these for my application?


An Error Was Encountered

Error Number: 1062

Duplicate entry '123413421' for key 2

INSERT INTO vehicles (vin, stock, type, year, price, mileage, transmission, ext_color, int_color, body_style, doors, drive_train, engine, wheel_base, load_rating, notes, additional_opts, model_id, trim_id) VALUES ('123413421', '1234567', 'New', '2009', '', '', '', '', '', 0, 'null', 'null', '', '', '', '', '', '4', '18')


I'd much rather display something more user friendly to the non-tech type. I do realize I have to add sanity checking for duplies entries in my actual PHP, but where I miss these types of checks, what's my best bet?

- sf


Graceful error messages - El Forum - 09-04-2007

[eluser]mmm_broccoli[/eluser]
just disable error reporting, and during your normal error checking code you can output your own messages