Can you ask ruby to treat warnings as errors?

后端 未结 3 1039
走了就别回头了
走了就别回头了 2020-12-01 11:03

Does ruby allow you to treat warnings as errors?

One reason I\'d like to do this is to ensure that if heckle removing a line of code means that a warning occurs, I h

3条回答
  •  感动是毒
    2020-12-01 11:42

    You could also potentially use DTrace, and intercept the calls to rb_warn and rb_warning, though that's not going to produce exceptions you can rescue from somewhere. Rather, it'll just put them somewhere you can easily log them.

提交回复
热议问题