exception-handling

NO_DATA_FOUND exception not thrown when used in SELECT INTO

自古美人都是妖i 提交于 2019-12-23 10:06:45
问题 I noticed strange behaviour of NO_DATA_FOUND exception when thrown from function used in PLSQL. Long story short - it does propagate from function when using assignment, and does not propagate (or is handled silently somewhere in between) when used in SELECT INTO . So, given function test_me throwing NO_DATA_FOUND exception, when invoked as: v_x := test_me(p_pk); It throws an exception, while when invoked as: SELECT test_me(p_pk) INTO v_x FROM dual; it does not throw exception. This does not

Is an object constructed if an initializer throws?

末鹿安然 提交于 2019-12-23 10:06:44
问题 I was reading This Article over on Jag Reeghal's blog and It seemed to me that what he was suggesting was really not the same thing as using an object initializer. Then I realized that I didn't really know for sure. When an object is constructed, with object initializers, and one of those intitializers throws (maybe a Null Reference exception)... is the object actually constructed? Is this basically like an exception being thrown in the constructor? Or is the object fully constructed, and

Is an object constructed if an initializer throws?

不打扰是莪最后的温柔 提交于 2019-12-23 10:06:10
问题 I was reading This Article over on Jag Reeghal's blog and It seemed to me that what he was suggesting was really not the same thing as using an object initializer. Then I realized that I didn't really know for sure. When an object is constructed, with object initializers, and one of those intitializers throws (maybe a Null Reference exception)... is the object actually constructed? Is this basically like an exception being thrown in the constructor? Or is the object fully constructed, and

C++ Exception Handling

走远了吗. 提交于 2019-12-23 10:03:21
问题 So I was writing some code and I noticed that apart from syntactical, type, and other compile-time errors, C++ does not throw any other exceptions. So I decided to test this out with a very trivial program: #include<iostream> int main() { std::count<<5/0<<std::endl; return 1 } When I compiled it using g++, g++ gave me a warning saying I was dividing by 0. But it still compiled the code. Then when I ran it, it printed some really large arbitrary number. When I want to know is, how does C++

Why do I not get the “Cross-thread operation not valid” error

隐身守侯 提交于 2019-12-23 09:48:06
问题 I use a BackgroundWorker and do this: private void loadNewAsyncToolStripMenuItem_Click(object sender, EventArgs e) { this.Text = "RunWorkerAsync()"; backgroundWorkerLoading.RunWorkerAsync(); } private void backgroundWorkerLoading_DoWork(object sender, DoWorkEventArgs e) { UnsafeThreadMethod("hello"); EvenUnsaferThreadMethod(); } And now the two methods. private void UnsafeThreadMethod(string text) { toolStripLabelRssFeedData.Text = text; } private void EvenUnsaferThreadMethod() { panelLoading

Thread exiting with uncaught exception

左心房为你撑大大i 提交于 2019-12-23 09:38:08
问题 my app is nearly done. I'm only doing the bugfixing now. I'm running into a problem that I sometimes randomly (so not always the same time or after the same actions are done) get my app crashed. LogCat just tells me threadid=11 thread eixiting with uncaught exception (group=0x4134d2a0) But there is no "caused by" what normally would come so I can actually catch the exception. When it crashes (randomly) this gets written into my console [2013-10-22 15:39:36 - ddms] null java.lang

Casting a generic element type downwards

会有一股神秘感。 提交于 2019-12-23 09:25:51
问题 public class ConfigControlBase<T> : UserControl where T : ProviderBase { public T Provider { get; set; } public void Init(T provider) { this.Provider = provider; } } public abstract class ProviderBase { public abstract ConfigControlBase<ProviderBase> GetControl(); } public class ProviderXConfigControl : ConfigControlBase<ProviderX> { } public class ProviderX : ProviderBase { public override ConfigControlBase<ProviderBase> GetControl() { var confControl = new ProviderXConfigControl() as

How do I setup configuration when I use command line to build C#/.NET?

一个人想着一个人 提交于 2019-12-23 08:11:31
问题 When my program tries to access the dll in the network drive, I got this error message. Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///Z:\smcho\works\tasks\2011\ni\ng_fpgabackend\myclass.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous

Checking CustomErrors turned on in Code

不羁岁月 提交于 2019-12-23 08:07:21
问题 Is it possible to check weather custom errors is turned on or off in the code on web application runtime. 回答1: I've figured out how to do it it's in... HttpContext.Current.IsCustomErrorEnabled 回答2: You can use WebConfigurationManager.OpenWebConfiguration to obtain the configuration for the website, then use that to get the custom errors block: Configuration configuration = WebConfigurationManager.OpenWebConfiguration(null); CustomErrorsSection customErrorsSection = configuration.GetSection(

Handle ORACLE Exceptions

半世苍凉 提交于 2019-12-23 07:59:39
问题 I need to handle the ORA-01400 error (cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME") ) using a exception handle. ORACLE Predefine a few Exceptions like (ACCESS_INTO_NULL, ZERO_DIVIDE and so on), but apparently does not define an Exception for the ORA-01400 error, how do I handle this particular error code? I need something like this (other suggestions are accepted). .... ... INSERT INTO MY_TABLE (CODE, NAME) VALUES (aCode,aName); COMMIT; EXCEPTION WHEN NULL_VALUES THEN /* i don