【发布时间】:2022-01-06 08:49:02
【问题描述】:
在 C# 和 Python 中,我可以将代码包装在 try-except 子句中,其中包含针对不同异常类的多个 except 部分。
try:
# Do something
except ExceptionType1:
# return A
except ExceptionType2:
# return B
我可以在 NodeJS 中做类似的事情吗?
【问题讨论】:
-
@GOTO0 - 是的。谢谢!