How to troubleshoot any error while coding

ReferenceError? Parse error?

Does that make your head spin and want to throw the computer out of window?

Don’t worry, there is very easy guide how to troubleshoot any error while developing your webpage or application.

Step by step

1. Find the error message

This is fundamentals. Are your words “this is not working for me”? Now the very first things you should do is to find the error that is causing the “not working”

If using apache/nginx – look for server/vhost error logs. If using php, look for php logs, if using postgresql, look for database logs, if working with JavaScript, look into the console.

2. Google the error

Yes, it is that simple.

The reason is that the technologies we are using for web development are so wide spread that it is so unlikely that you encounter an error that anybody else has not encountered.

But there is a rule you need to follow:

Google only framework’s or application error, not the custom errors created by you.

Ivan Hanak

For example if you’ve been given an error:

Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in /users/ivanhanak/my-projects/yummy-dummy-website/index.php on line 5

Don’t google that.

Google only the error message without the custom phrases, like for example skip a file path and the line number.

For example when given the error above, google only:

Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN)

Skip entirely the file name and file line. Google via its magic powers somehow will find webpages containing the error above, where the file names and line numbers are not important, but the important are the answers and solutions.

Hope this helps.

Your in coding.


Leave a comment

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