docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0096: try or catch that does nothing

A try covers no call that throws, or no error reaches a catch. Remove it.

nabi
let n = try 1 + 2;
println(f"{n}");
warning[E0096]: this `try` covers no throwing call
  --> main.nabi:1:9
   |
 1 | let n = try 1 + 2;
   |         ^^^^^^^^^

Remove the try:

nabi
let n = 1 + 2;
println(f"{n}");
3

This is a warning: the program still builds.

Related: E0062 error not handled, E0064 optional operator on a value that is not optional

Found a mistake? Edit this page on GitHub. Last updated