getsentry / getsentry/sentry-javascript

Improve handling of `HttpResponseError` objects being captured in Angular SDK

Đang mở
#15,239 9 bình luận 0 reaction 2 người được giao Được @s1gr1d nhận Xem trên GitHub
Angular Improvement
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

### Is there an existing issue for this?

- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [x] I have reviewed the documentation https://docs.sentry.io/
- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

### How do you use Sentry?

Sentry Saas (sentry.io)

### Which SDK are you using?

@sentry/angular

### SDK Version

8.52.0

### Framework Version

19.1.0

### Link to Sentry event

_No response_

### Reproduction Example/SDK Setup

https://github.com/cobyeastwood183/angular

[error.json](https://github.com/user-attachments/files/18612067/error.json)
```json
{
"headers": {
"headers": {},
"normalizedNames": {},
"lazyUpdate": null
},
"status": 0,
"statusText": "Unknown Error",
"url": "http://some.example.com/test",
"ok": false,
"name": "HttpErrorResponse",
"message": "Http failure response for http://some.example.com/test: 0 Unknown Error",
"error": {
"isTrusted": true
}
}
```

### Steps to Reproduce

1. npm install
2. add DSN
3. npm start
4. visit http://localhost:4200/test
5. click button "Test API 2(Localhost)"

### Expected Result

Expect a HttpException to be captured for [HttpErrorResponse](https://angular.dev/api/common/http/HttpErrorResponse).

### Actual Result

Instead 'unknown' is captured when caught by the ErrorHandler or 'Object.error' when caught by calling captureException.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.