20120426-142815.jpg

언제부턴가 필통속엔 샤프가 밀려나고 연필이 가득차고 있다. 사각개는 느낌이 좋아 계속 애용중이다. 오랜만에 집 구석에 담긴 펜을 꺼내들었다. 낡았지만 무엇과도 바꾸고 싶지 않은 펜. 늦은밤 아버지께서 사다주신 펜.. 새로운 심을 채워 넣고 다시 시작이다.

1. 기본적인 처리 : 콘솔에 에러 출력함.

process.on('uncaughtException', function(err) {
console.log(err);
});

2. express 에서 처리 : 에러 메세지를 처리함. -> 이유를 모르겠으나 실행되지 않음.

app.error(function(err, req, res) {
res.end(err);
});

3. 현재로서 해결책[1]
3.1 에러 객체를 만들고.

var HttpException = function (request, response, message, code) {
this.request = request;
this.response = response;
this.message = message;
this.code = code || 500;
}

3.2 에러가 발생하면

throw new HttpException(request, response, 'File not found', 404);

3.3 에러를 처리한다.

process.on('uncaughtException', function (exception) {
exception.response.writeHead(exception.code, {'Content-Type': 'text/html'});
exception.response.end('Error ' + exception.code + ' - ' + exception.message);
});

 

TODO 위와 같이 하면 Exception을 발생시키기 위해 request, response를 모두 가지고 있어야 함. 구현 방법 고민 필요.

  1. [1] http://goo.gl/UkjYd 참조

참고해서 설치 완료!!

saltfactory :: Mac에서 macports를 이용하여 mongoDB 설치하기.

크롬으로 웹 개발시 콘솔을 활용하면 훨씬 편한 개발을 할 수 있다. 콘솔을 활용하는 몇가지 팁을 정리해 본다.

1. 기본 사용법

console.log(“출력”);

 

2. 타입별 사용

console.info(“info”);

console.warn(“warn”);

console.error(“error”);

 

3. (펼침)그룹별 사용

console.group();
console.log(“1″);
console.log(“2″);
console.log(“3″);
console.groupEnd();

 

4. (닫힘)그룹 사용

console.groupCollapsed(“닫힌그룹”);
console.log(“1″);
console.log(“2″);
console.log(“3″);
console.groupEnd();

 

5. 시간 로깅

console.time(“timeLog”);
setTimeout(function() {
console.timeEnd(“timeLog”);
}, 200);

 

참고 : 작은자유님 – 크롬 개발자 도구 활용 팁

맥에서 사용하는 마우스 휠 방향은 윈도우의 그것과 방향이 반대이다. 라이온을 사용하면서 적용된 바뀐 휠 방향에 적응하는건 어렵지 않았으나, 윈도우를 함께 사용해야 하므로 자꾸 혼동하게 된다. 그래서 윈도우의 휠 방향을 바꿔주는 툴을 찾아보았으니.. 바로 이것.

XMouseButtonControl

위 사이트에 접근하여 프로그램을 설치하고,

Mouse Wheel Down을 up으로 Mouse Wheel Up을 Down으로 바꾸면 완료.

그외 여러가지 기능이 있다.