Display full error object all the time regardless of argument position

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
devtools

Hướng nghiên cứu

Start with the behavior in src/common.js at the linked line and review the README's debug argument documentation. Check issues #334 and #711 for existing decisions or constraints. Document how Error objects are displayed based on argument position, or clarify the agreed scope if an option is required; the README should accurately describe the resulting behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

A quick explanation:

var debug = require('debug')('http');

const error = new Error('hi');
error.info= { display: 'me' };
debug(error) ;
debug('', error); // this will output info object 

This is not mentioned in the readme and I had to hunt the reason for this. If an error is the first argument, it will be coerced.

https://github.com/debug-js/debug/blob/f66cb2d9f729e1a592e72d3698e3b75329d75a25/src/common.js#L82

At the very least, this behavior should be documented in the readme.

An option could be added to change this behavior. At first, the option could default to the current behavior and then the default behavior can be changed after a reasonable period.

This issue is related to https://github.com/debug-js/debug/issues/334. This open issue is also related, https://github.com/debug-js/debug/issues/711.

Ngôn ngữ chính
JavaScript
Star
11.5k
Fork
992
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 debug-js/debug

Tất cả issue của debug-js/debug

Issue tương tự

Thêm issue về JavaScript

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.