Forums / General Questions / Friendly error page for users?

Friendly error page for users?

Locked
Results 1 to 8 of 8
This thread is locked. New replies are disabled.
26 Mar 2009, 20:28
#1
daveburns avatar

daveburns

New Zenner

Join Date:
Mar 2009
Posts:
3
Plugin Contributions:
0

Friendly error page for users?

I'm new to Zen-cart. Sorry if this is a FAQ although I don't see this covered in any FAQ. I have a stock config of Zen-cart 1.3.8 newly installed on a Windows server.

Before getting things configured 100%, I noticed error messages presented to the user. Is there a way to send the ugly details to an admin and present a friendlier face to the user? To be specific:

I had my email config incorrectly configured. After I created a test user account, zencart tried to send me the new-account-creation email. My browser presented a plain white page with the text: 'couldn't find /usr/bin/sendmail'. The error message is correct - no complaints there. My issue is that this is what was shown to the user and there is no other link or button to let them proceed - it's sort of a dead end. I'd prefer it if that message were sent to an admin (maybe even with some info about how the user got to that) and that the user was presented with a page that looked like my theme with an apology message and then a link/button to proceed. I understand that this won't happen again now that I have things properly set up but errors can and will happen unexpectedly.

Hopefully I've missed some feature that already exists and just needs to be configured. Any thoughts?
26 Mar 2009, 21:28
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Friendly error page for users?

Well, two things occur to me in response to that.

1. It behooves one to go through all of the store's functionality to make sure things are working, before opening to the public. This includes creating accounts, adding products, placing those products in the cart, and completing checkout with the payment gateway you intend to use. And then optionally refunding the transaction if it's appropriate.

2. Email system error messages are enabled by default so that you, the shopowner, can see all those messages first-hand when they occur. You can disable that by switching the "Friendly Email Errors" option on in Admin->Configuration->Email Options if you so desire.


As for a generic "sorry, we encountered an error" page, that's not a built-in option at this point.
There is a general PHP-Error debug logging utility in the free addons area that can be used to collect PHP errors for the storeowner to review from time to time, which may be of some related value to you.
26 Mar 2009, 21:46
#3
daveburns avatar

daveburns

New Zenner

Join Date:
Mar 2009
Posts:
3
Plugin Contributions:
0

Re: Friendly error page for users?

Thanks for the quick reply. My thoughts:

Re #1: I agree of course that thorough testing is required. That's how this came up. The store is not open to the public yet.

Re #2: I'll make use of that config option but my comments were pointed more towards error handling in general. No matter how diligent one is, errors will happen. Spurious issues could occur or maybe a hosting provider makes a change without thinking it would affect you, etc.

Again, thanks for response. I'll post this feature request on the appropriate forum section.

Dave
27 Mar 2009, 08:12
#4
tophand avatar

tophand

Totally Zenned

Join Date:
Jan 2007
Posts:
674
Plugin Contributions:
0

Re: Friendly error page for users?

[quote=DaveBurns;706121
The error message is correct - no complaints there. My issue is that this is what was shown to the user and there is no other link or button to let them proceed - it's sort of a dead end. I'd prefer it if that message were sent to an admin (maybe even with some info about how the user got to that) and that the user was presented with a page that looked like my theme with an apology message and then a link/button to proceed. I understand that this won't happen again now that I have things properly set up but errors can and will happen unexpectedly.

Hopefully I've missed some feature that already exists and just needs to be configured. Any thoughts?[/quote]

Build you own error pages.
http://www.zen-cart.com/forum/showthread.php?t=78132
27 Mar 2009, 09:39
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Friendly error page for users?

DaveBurns:

Re #2: I'll make use of that config option but my comments were pointed more towards error handling in general. No matter how diligent one is, errors will happen. Spurious issues could occur or maybe a hosting provider makes a change without thinking it would affect you, etc.

Again, thanks for response. I'll post this feature request on the appropriate forum section.
You're assuming rather a lot from a single error message. As DrByte said, email messages can be made more friendly. Other errors are suppressed by default (implemented as part of the 1.3.8 release) to stop them from being visible to customers, which is why the debug facility, also referred to by DrByte, is needed. So it's not clear what additional feature request you would be making.
27 Mar 2009, 11:30
#6
daveburns avatar

daveburns

New Zenner

Join Date:
Mar 2009
Posts:
3
Plugin Contributions:
0

Re: Friendly error page for users?

@kuroi -

I don't think I'm making an assumption. DrByte said "As for a generic "sorry, we encountered an error" page, that's not a built-in option at this point." That's the feature I'd request.
27 Mar 2009, 11:38
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: Friendly error page for users?

Yes that makes sense. Far and away the most common errors arise because the cart's gotten goobered up. Misplaced apostrophes in the middle of language strings or missing files for example. These usually kick out errors that cause the PHP parser to fail completely, i.e. outside of Zen Cart. I wonder if there's a way to trap this and load a static error page. Technically this would be outside of Zen Cart, but practically might be nice to be bundled with it.
27 Mar 2009, 15:30
#8
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Friendly error page for users?

If you want to catch php fatal error, try: http://us.php.net/set-error-handler

If you want to catch page not found error and redirect clients to a friendlier zencart page, use htacccess mod rewrite for that purpose.