Skip to Content
한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트
book

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

by 한성용, 이선 브라운
April 2016
Beginner to intermediate
389 pages
9h 8m
Korean
Hanbit Media, Inc.
Content preview from 한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트
367
22
-
유지보수
문제가 없지만,
AJAX
핸들러 자체에 에러가 있어 서버가 응답 코드
500
을 보내거나 유효하지
않은
JSON
을 반환한다면, 이 방법은 실패했음을 인식하지 못합니다(조용히 실패합니다)
.
용자 정보는 공허 속으로 사라지고, 사용자는 당혹스러워할 겁니다. 전송이 성공했으면(첫 번
째 저장 방법이 실패하더라도, 사용자 정보를 어디에든 저장했다면)
success
프로퍼티가 들어
있는 객체를 반환하게 만드십시오. 그러면 클라이언트 쪽 코드는
if
(
data
.
success
){ /*
잘 저
장됐다는 감사 메시지를 표시
*/ }
else
{ /*
사용자에게 실패했음을 알림
*/ }
같은 형태가 될 겁니다.
22.1.10.
‘보이지 않는’ 실패를 막으십시오
늘 보는 일입니다. 개발자가 바쁘면, 에러를 기록하긴 하지만 체크할 방법을 마련하지 않습니
다. 로그 파일이든, 데이터베이스 테이블이든, 클라이언트 쪽의 콘솔 로그든, 죽은 링크로 가는
이메일이든, 결과는 같습니다. 웹사이트에 품질 문제가 있는데 아무도 모릅니다
.
이 문제를 막
으려면 ‘쉽고’ 표준적인 방법을 써서 에러를 기록하십시오
.
문서화하십시오. 어렵게 만들지 마
십시오. 모호하게 만들지 마십시오. 프로젝트에 참가하는 개발자라면 모두 그 방법에 대해 알
수 있게 하십시오. 어려운 일도 아닙니다.
meadowlarkLog
함수를 만들고 공유하기만 하면 됩
니다(
log
함수는 다른 패키지에서 자주 사용하니까요). 함수가 로그를 데이터베이스에 기록하
든, 파일에 기록하든,
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

한선용, 이선 브라운

Publisher Resources

ISBN: 9788968482229