[node] Error.captureStackTrace() (feat. 문제 해결력을 증진시키는 flow)
상황 module.exports = function TistoryError(message, status, sentry = false, extras, rspCode) { Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; this.message = message; } require('util').inherits(module.exports, Error); 이런 코드가 있었다고 했을 때, captureStackTrace 함수를 처음 마주쳐서 무슨 기능을 하는건지 알 수 없었다. 잘못된 방향 captureStackTrace를 무작정 구글링 올바른 방향 해당 코드에서 레이어를 더 들어갈 수 있다면 계속 들어가주기 -..
TIL (Today I Learned)
2022. 2. 7. 10:22