분류 전체보기
-
NestJS class-validator 사용시 일관성 있는 에러처리Nest.js 2024. 3. 8. 12:25
Reference - https://dev.to/nithinkjoy/how-to-use-class-validator-and-return-custom-error-object-in-nestjs-562h How to use class-validator and generate custom error object in nest.js Objective The main objective of this article is showing how to generate custom error... dev.to - https://stackoverflow.com/questions/60270468/throw-same-error-format-as-class-validator-in-nestjs Throw same error form..
-
-
-
-
NestJS 개발시 tsconfig 설정시 strictNullChecks를 true로 하지 않을때Nest.js 2024. 2. 24. 15:04
NestJS 프로젝트시에 tsconfig 설정시 strictNullChecks를 true나 또는 strict true로 설정하지 않고 프로젝트를 하게 되면 typeorm의 findOne 함수를 예로 들었을때 typeorm의 type 스펙과 다른 결과가 다를 수 있다. findOne(options: FindOneOptions): Promise; typeorm의 findOne 또는 findOneById등 메소드들의 type의 리턴값은 Promise 이다. 그러나 strictNullChecks를 false로 지정 했을경우 원래 당연히 PostsModel | null 이렇게 추론 되어야 하는데 strictNullChecks를 false로 지정 했기 때문에 PostsModel로 추론 되는걸 알 수 있다. 결론적으..
-
NestJS에서 WebSockets 파트에서 AdaptersNest.js 2024. 2. 21. 20:50
https://docs.nestjs.com/websockets/adapter Documentation | NestJS - A progressive Node.js frameworkNest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Readocs.nestjs.com 공식문서에서 websocket에서 adapter ..
-
<w> [webpack.cache.PackFileCacheStrategy]Next.js 2024. 2. 14. 12:18
해당 에러는 내가 next.config.js 파일을 수정 한 이후에 발생했다. 개발환경은 docker이고 Dockerfile은 다음과 같다. FROM node:18-alpine3.18 WORKDIR /app COPY *.* /app RUN npm install COPY . /app RUN npm run build CMD [ "npm" , "run" , "dev"] 열심히 구글링 해본 결과 해당 오류를 제거 하려면 .next파일을 delete 한후 다시 docker 파일을 실행하니까 해결 됬다!
-
프론트에서 restapi를 이용한 http 통신을 할때 4xx번대 에러 또는 500번대에서 network 오류가 발생 했을때 크롬의 network 오류 표시Next.js 2024. 2. 3. 15:05
backend에서 일부러 403 에러를 던지게 구성 했을때 특정한 에러를 감지하기 위해 try catch 또는 .catch 등 특정 에러를 처리 하기 위해 제공 되는것들을 활용한다. 그렇게 했을때 console.log를 출력 해보면 Axios를 이용 했을때 catch 문이 실행 되면서 AxiosError를 출력 해볼 수 있고, 이것을 통해서 에러를 핸들링 하거나 처리 할 수 있다. 근데 나는 항상 프론트 개발을 하면서 크롬 브라우저에서 해당 빨간색 에러 network에러가 보이는게 너무 거슬렸다. 특히나 accessToken이 만료되어 refreshToken을 이용하여 다시 accessToken을 발급 하는 로직을 구성 했을때 뭐만 하면 401 에러가 크롬 브라우저 콘솔에 뜨는게 거슬렸다. 결론부터 말하..