100
91

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

wtf!!!!!!!!!!!!!!!!!!!!!!??????????????????

Posted at

tl;dr

wtfを使おう

概要(というか全部)

pryにはwtfというコマンドがあります。これは最後に起こったエラーのバックトレースを数行表示してくれるものです。これだけでも便利ですが、バックトレースが全部欲しいときはwtf!?のように、!?を後置するといけます。しかもこれ、いくつでも大丈夫です。なので、
wtf!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
みたいに激怒しても、pryはいつもどおりにバックトレースを返してくれます。
理不尽なエラーに襲われたら盛大に激怒しましょう(そしてバックトレースを活用してデバッグしましょう)。

おまけ

wtfをタイポすると、NameErrorが起きてしまい最後の例外が上書きされるので気をつけて…

100
91
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
100
91

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?