# Error causes in the Console

> Clean Markdown view of GeekNews topic #15189. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=15189](https://news.hada.io/topic?id=15189)
- GeekNews Markdown: [https://news.hada.io/topic/15189.md](https://news.hada.io/topic/15189.md)
- Type: news
- Author: [ragingwind](https://news.hada.io/@ragingwind)
- Published: 2024-06-06T07:12:59+09:00
- Updated: 2024-06-06T07:12:59+09:00
- Original source: [twitter.com/addyosmani](https://twitter.com/addyosmani/status/1798406004427903287)
- Points: 5
- Comments: 0

## Topic Body

이제 크롬에서도 `Error: cause` 데이터 필드를 이용해서 rethrowing 되는 예외도 이제 콘솔 에서 출력 되는 스택 트레이스에서 `Caused by` prefix 를 사용해서 여러개의 에러 스택이 표현 됩니다.  
  
```  
try {  
  connectToDatabase();  
} catch (err) {  
  // cause: err 를 이용해서 이전 err 를 연결 해요  
  throw new Error("Connecting to database failed.", { cause: err });  
}  
```  
  
### More  
  
- Caused by: prefix / https://developer.chrome.com/blog/new-in-devtools-125?hl=en#error-cause  
- Error: cause - JavaScript | MDN / https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause#examples

## Comments



_No public comments on this page._
