D76 #100DaysOfCode

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 an 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!


Written on December 5, 2019