Error

Правильная организация наследования

/**
 * Created by mirocow on 01.05.14.
 */
 
var until = require('util');
var phrases = {"Hello": "Привет"};
 
function PhraseError(message){
    this.message = message;
}
util.inherits(PhraseError, Error);
PhraseError.prototype.name = "PhraseError";
 
function HttpError(status, message){
    this.message = message;
    this.status = status;
}
util.inherits(HttpError, Error);
HttpError.prototype.name = "HttpError";
 
function getPhrase(name){
    if(!phrases[name]){
        throw new Error("Нет такой фразы: " + name);
    }
    return phrases[name];
}
 
function makePage(url){
    if(url != "index.html"){
        throw new Error("Нет такой страницы");
    }
    return util.format("%s, %s!", getPhrase("Hello"), getPhrase("world"));
}
 
try {
    var page = makePage('index');
    console.log(page);
} catch (e) {
    if(e instanceof HttpError){
        console.log(e.status, e.message);
    } else {
        console.error("Ошибка %s\n сообщение %s\n стек %s", e.name, e.message, e.stack);
    }
}