Skip to main content

format_uncaught

Function format_uncaught 

Source
pub fn format_uncaught(context: &str, value_repr: &str) -> String
Expand description

捕捉されなかった例外の 1 行メッセージを組み立てる。

  • context … どこで起きたか("click listener" 等)。空なら省略する。
  • value_repr … 例外値の文字列化。空なら "<no message>" とする (空文字のまま出すと「何も起きていない」ように見えてしまうため)。

長すぎる場合は MAX_UNCAUGHT_LEN で切り詰め、末尾に を付ける。