Ruby 2.4

SecurityError

SecurityError类

Parent:Exception

尝试潜在的不安全操作时引发,通常在$ SAFE水平提高到0以上时。

foo = "bar" proc = Proc.new do $SAFE = 3 foo.untaint end proc.call

引发了一个例外:

SecurityError: Insecure: Insecure operation `untaint' at level 3