Fixed the way custom errors are created

As some people pointed out to me on StackOverflow, the correct way to create custom errors is by passing an instance of Error as prototype, not Error's prototype itself. I thought I'd share with you.
See comments here : http://stackoverflow.com/questions/23377382/how-do-i-determine-if-a-variable-is-an-error-in-javascript#23377596