Opaque with_scope behaviour with exceptions in block

Đang mở
#1,855 9 bình luận 2 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@sl0thentr0py đang làm issue này rồi.

Từ ngày 25/7/2022.

Đánh giá

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

Mô tả

Discussion Errors Improvement Question Ruby sentry-ruby

Creating this issue for further discussion.

If you do the following, the exception will be captured but the tag won't be used (because that scope is thrown away in an ensure).

    Sentry.with_scope do |scope|
      scope.set_tags(my_tag: "my value")
      1 / 0
    end

If you do the following, the exception will be captured and the tag will be visible.

    Sentry.with_scope do |scope|
      scope.set_tags(my_tag: "my value")

      begin
        1 / 0
      rescue => e
        Sentry.capture_exception(e)
      end
    end

Originally posted by @sl0thentr0py in https://github.com/getsentry/sentry-docs/pull/5328#issuecomment-1194148134

Ngôn ngữ chính
Ruby
Star
990
Fork
552
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-ruby

Tất cả issue của getsentry/sentry-ruby

Issue tương tự

Thêm issue về Ruby

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.