Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
在 C# 中,为什么变量没有在finally 块的开头明确赋值?
我不明白为什么下面的代码会产生错误 通常我可以从语言规范中弄清楚事情 但在这种情况下我不理解语言规范 顺便说一句 这不会在我的代码中造成问题 我只是想理解这种语言 Example bool success try success true
c
trycatch
Swift try inside Objective-C 块
我需要创建一个函数foo它接受一个抛出闭包作为参数 我可以使用 Swift 或 ObjC 来实现它 但我需要能够从两者中调用它 像这样 Swift func bar throws func foo block throws gt void
Objectivec
swift
errorhandling
closures
trycatch
将 c++ 异常传播到 cython - python 异常
我的 Cython 0 17 1 有问题 我的函数抛出一个std runtime error如果文件不存在 我想以某种方式将此异常传播到我的 Cython 代码 void loadFile const string filename som
c
python
Exception
trycatch
Cython
jquery 隐藏简单的 javascript 错误
我在 chrome 和 firefox 中使用 jQuery 和 flot 当我编写代码时 我发现执行在一些愚蠢的事情上会默默失败 例如访问不存在的哈希结构等 感觉 jQuery 中有一些 try catch 逻辑 让我看不到任何错误 有没
jQuery
debugging
syntax
trycatch
JSLint 抱怨我的 try/catch
javascript 运行时JSLint http jslint com 对我大喊大叫 我不知道为什么 jslint browser true devel true evil true undef true nomen true eqeqe
javascript
Exception
errorhandling
trycatch
jslint
捕获 SwiftUI 中的错误
我在某些视图中有一个按钮 它调用 ViewModel 中可能引发错误的函数 Button action do try self taskViewModel createInstance name self name catch Databa
ios
SwiftUI
trycatch
throw
PowerShell Get-ChildItem 如何捕获异常
我目前正在编写一个可视化错误 GUI 它可以在处理时捕获任何异常 并向用户提供 易于理解 的错误消息 但似乎我在使用时无法捕获任何异常Get ChildItemcmdlet 我是否必须使用与 try catch 不同的方法 这是 Power
PowerShell
Exception
trycatch
如何通过注解用try-catch包装方法?
如果应该在方法调用中忽略异常 则可以编写以下内容 public void addEntryIfPresent String key Dto dto try Map
Java
Spring
trycatch
我应该把 try/catch 和“using”语句放在哪里? [复制]
这个问题在这里已经有答案了 可能的重复 try catch using 正确的语法 https stackoverflow com questions 4590490 try catch using right syntax 我想try c
c
trycatch
usingstatement
如何将函数内的捕获错误传递给父级
我有这几行代码示例 想知道下面的逻辑到底如何 try var response child console log why here catch err console log should show this err function c
javascript
trycatch
Java Try Catch Final 没有 Catch 的情况下会阻塞
我正在审查一些新代码 该程序只有一个 try 和一个 finally 块 既然排除了 catch 块 那么如果 try 块遇到异常或任何可抛出的内容 它如何工作 它直接进入finally块吗 如果 try 块中的任何代码可以引发已检查异常
Java
trycatch
finally
trycatchfinally
tryfinally
如何避免重复的 try catch 块
我有几种类似这样的方法 public void foo try doSomething catch Exception e Log Error e 我可以把代码改成这样吗 LogException public void foo doSom
c
attributes
trycatch
如何捕获 try-with-resource 语句中 close 方法抛出的异常
我正在读关于try with resourceJava 中的语句可用于指定任意数量的资源 try Resource1 res1 initialize code Resource1 res2 initialize code statement
Java
Exception
trycatch
C++ 获取 catch(...) 块中捕获的异常的描述
我可以得到捕获的异常的描述吗 catch 堵塞 就像是 what std 异常 您可能可以使用一个技巧 catch handle exception void handle exception try throw catch const s
c
Exception
trycatch
为什么我不能在 super() 调用周围使用 try 块?
因此 在 Java 中 构造函数的第一行必须是对 super 的调用 无论是隐式调用 super 还是显式调用另一个构造函数 我想知道的是 为什么我不能在它周围放置一个 try 块 我的具体情况是我有一个模拟课程用于测试 没有默认的构造函数
Java
Exception
mocking
trycatch
红宝石接球和效率
catch在 Ruby 中意味着跳出深度嵌套的代码 在 Java 中 例如用Java也可以达到同样的效果try catch用于处理异常 但它被认为是糟糕的解决方案 而且效率非常低 在 Ruby 中 我们有处理异常的方法begin raise
ruby
performance
trycatch
throw
controlstructure
try-catch 中未处理的异常
try list from XElement e in d Descendants wix File where e Attribute Name Value Contains temp Name e Parent Parent Attri
c
Exception
trycatch
unhandledexception
捕获 foreach 条件中抛出的异常
我有一个foreach在 foreach 本身的条件下循环期间中断的循环 有没有办法try catch抛出异常然后继续循环的项 这将运行几次 直到异常发生然后结束 try foreach b in bees exception is in
c
Exception
foreach
trycatch
Python——捕获异常的效率[重复]
这个问题在这里已经有答案了 可能的重复 Python 常见问题解答 异常有多快 https stackoverflow com questions 8107695 python faq how fast are exceptions 我记得
python
performance
trycatch
将字符串转换为双精度 - VB
VB中有没有一种有效的方法来检查字符串是否可以转换为双精度型 我目前正在尝试将字符串转换为双精度型 然后查看它是否引发异常 但这似乎减慢了我的申请速度 Try if number then format it current CDbl x
VBNET
string
double
trycatch
1
2
3
4
5
6
...13
»