Tizen 上的 C++ 异常处理

标签 c++ exception exception-handling tizen tizen-native-app

谁能解释一下 Tizen 中的异常处理?

在FAQ中我发现:

Q: Can I use C++ try-catch exception handling?

A: No, C++ try-catch exception handling is not supported in Tizen.

但在我的实验中,c++ try catch 在 Tizen 设备上测试时运行良好。

这是我做的:

  1. 打开 Tizen SDK
  2. 创建一个空的 Tizen Native C++ 项目
  3. 在 main 中放一个 try catch 语句。将日志放入 catch 并尝试。

这是否意味着我可以将 try catch 用于我的方法,但不能用于 Tizen API 和类?

最佳答案

Does this mean that i can use try catch for my methods but not for Tizen APIs and Classes?

是的。来自 the online documentation :

Error handling in Tizen works differently compared to standard C++. Tizen uses error results instead of C++ exceptions, due to historical reasons.
...
The above exception handling model only affects the Tizen platform. When developing your own application, you can use the C++ exception handling mechanism as well. Handle exceptions for your own code with either Tizen exceptions or C++ exceptions.

关于Tizen 上的 C++ 异常处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17104060/

相关文章:

java - TicTacToe 游戏的 OutOfBoundsException;问题: arrays?

c++ - Valgrind:抛出自定义异常时为 "invalid read size 1"

python - 如何使用调试信息记录 Python 错误?

c++ - istream 读取失败时存储的值

c++ - 在运行时获取 DLL 路径

silverlight - 响应式扩展中的跨线程异常与限制

java - 使用 Spring Security 标签库时将异常映射到 404 页面

Python 用户定义的异常放置和捕获

c++ - 虚函数是在编译期间确定的吗?

C++ ofstream不会将预期的数字写入文件