D76 #100DaysOfCode

D76 #100DaysOfCode Today I implemented some error handling to stop the site from crashing.

Read Time42Seconds

Today I implemented some error handling. I had an issue where if a user tried to change their name to something that was already in use the database would throw up and error. This would cause the site to crash.

So I implemented a fix so that the user would receive an error if they tried to change their name to something in use, and also set up some error pages that fit the look of the site.


As you can see from the screenshot above, I am trying to change my name to ‘TestUser’ nut since it’s in use I just get a nice simple error message rather than the site crashing.

Now when a user tries to access a page that doesn’t exist or they break the site they get something like this.

Here’s the site in action!

0 0
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleppy
Sleppy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Leave a Reply

Your email address will not be published. Required fields are marked *

Close