GoogleCloudPlatform / GoogleCloudPlatform/stackdriver-errors-js

Problem doing manual error reporting

Đang mở
#64 4 bình luận 4 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
360
Fork
54
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi, I have code that does:

```
// In a promise `then` handler:
myRegister(new Error('some error'));
// ...
// Elsewhere in the code:
errorHandler.report(theNewError);
```

but the stackdriver API response is:

```
{
"error": {
"code": 400,
"message": "ReportedErrorEvent.context must contain a location unless `message` contain an exception or stacktrace.",
"status": "INVALID_ARGUMENT"
}
}
```

The request that is sent to stackdriver is:

```
{
"serviceContext": {"service": "webApp", "version": "whatever"},
"context": {
"user": "Joe User",
"httpRequest": {
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
"url": "http://localhost:3000/"
}
},
"message": "Error: {\"type\":\"An error during API handling\"}\n at then(function (/Users/murphyke/Documents/code/myapp/web/src/actions.js:224:0)"
};
```

What is the recommendation? Do I have to annotate the error object somehow?

Unhandled exceptions are reported correctly.

Using Chrome, btw.

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.