Jump to content

How to display Errors


doubledee

Recommended Posts

I have a fairly complicated Q&A Form with 10 Inputs.

 

If there is a data entry error, then I re-load the Form display an error-message beneath the corresponding field.  No problems there.

 

Normally, if there was a more serious error (e.g. INSERT failed), then I would re-direct to a new page and display the error (or success) message there.  No problem again.

 

But here is where I am confused...

 

Because my code iterates through each of the 10 Inputs on my Q&A Form, there could conceivably be an error on each loop.

 

If I had two serious errors (e.g. INSERT error and UPDATE error), then how should I handle displaying the error?!

 

For those types of errors, I would usually re-direct, however there would usually be only one error to display, e.g.

Your profile answers could not be added due to a System Error.

 

 

Should I display every error that might occur for every one of the 10 Input fields, or does it make sense to just display one error, with the understanding that if one thing fails then everything does.

 

Hope that makes sense?!

 

Thanks,

 

 

Debbie

 

Link to comment
Share on other sites

Doesn't really matter. It's all preference. You should never get an INSERT or UPDATE error in a production environment.

 

Personally, I see a query error as a fatal error, and would throw an exception or otherwise stop execution of the script.

 

I don't see a reason to continue to check for more potentially script-breaking errors after the first one has occurred. Those will show up after you fix the first one any ways.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.