exception

WMI Access denied excptn

string s = Form1.ipadd; string devic; devic = comboBox1.Text; groupBox2.Text = devic + " Information"; ConnectionOptions _Options = new ConnectionOptions(); _Options.Username = "Babar"; _Options.Password = ""; ManagementPath _Path = new ManagementPath(s...

Is there a way to display a custom exception in an alert under Android?

I'm a newbie Android developer. I would like to know if there exists a way to listen for a custom exception in Android and display its text using an alert. Thank you. ...

Java: synchronized(Object) and RejectedExecutionException

Hello I have this problem: I have a few threads which access one object with synchronized(Object) { ... } But sometimes this exception is raised: execute: java.util.concurrent.RejectedExecutionException Why? And what should I do with it? Thanks ...

How to have an exception define its own message in C#?

I want to define a custom exception that has two special properties: Field and FieldValue, and I want the message to be built from those two values in the exception constructor. Unfortunately the Message is read only. This is what I have, but it still requires the message to be passed. public class FieldFormatException: Format...

How can I get the full string of PHP’s getTraceAsString()?

I'm using getTraceAsString() to get a stack trace but the string is being truncated for some reason. Example, an exception is thrown and I log the string using: catch (SoapFault $e) { error_log( $e->getTraceAsString() ) } The string thats prints out is: #0 C:\Somedirectory\Somedirectory\Somedirectory\Somedir\SomeScript.php(10): S...

BlackBerry - Exception when creating a graphics object from a bitmap

I am making the following call in my blackberry application (API ver 4.5)... public void annotate(String msg, EncodedImage ei) { Bitmap bitmap = ei.getBitmap(); Graphics g = new Graphics(bitmap); g.drawText(msg,0,0); } And I keep getting an IllegalArgumentException when I instantiate the Graphics object. Looking at the documen...

How can I check the failure in constructor() without using exceptions ?

All of the classes that I'm working on have Create()/Destroy() ( or Initialize()/Finalized() ) methods. The return value of the Create() method is bool like below. bool MyClass::Create(...); So I can check whether initialization of the instance is successful or not from the return value. Without Create()/Destroy() I can do the same j...

Is it a bad practice to use global exceptions in PL/SQL?

Is it a bad practice to do what the code below does? Will bad things happen to me for writing it? Edit: this is just an example. I would not use dbms_output for any real error reporting. CREATE OR REPLACE PACKAGE my_package AS PROCEDURE master; END; / CREATE OR REPLACE PACKAGE BODY my_package AS my_global_interrupt EXCEPTION; PROCE...

Retrieving doubly raised exceptions original stack trace in python

If I have a scenario where an exception is raised, caught, then raised again inside the except: block, is there a way to capture the initial stack frame from which it was raised? The stack-trace that gets printed as python exits describes the place where the exception is raised a second time. Is there a way to raise the exception suc...

Weird unpickling error when using multiprocessing

I get the following error when using multiprocessing: Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner self.run() File "/usr/lib/python2.6/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/usr/lib/python...

Java NoClassDefFound Errors

I'm running into a problem with a java app constantly throwing: java.lang.NoClassDefFoundError: Could not initialize class java.net.ProxySelector. I am running Suse Linux 10.3 and running java 1.6.0. My CLASSPATH is set to /usr/lib/jvm/jre-1.6.0-openjdk/lib. No other users seem to be having this error so I'm assuming its my ...

when to use assertion vs Exception

most of the time i will use exception to check for condition in my code, i wonder when is appropriate time to use assertion for instance, Group group=null; try{ group = service().getGroup("abc"); }catch(Exception e){ //i dont log error because i know whenever error occur mean group not found } if(group !=null) { //do something } ...

How do i know when a lambda expression is null

I need to programatically check whether a nested property/function result in a lambda expression is null or not. The problem is that the null could be in any of the nested subproperties. Example. Function is: public static bool HasNull<T, Y>(this T someType, Expression<Func<T, Y>> input) { //Determine if expression has a nul...

From which classes should I derive my custom DataAccessLayerException and DuplicateEntryException?

I want to add DataAccessLayerException and DuplicateEntryException classes. But I'm in big doubts of which classes should I derive from? For example DataAccessLayerException (will be used as a wrapper for exceptions thrown from data access layer) may be derived from Exception or DbException. But I'm afraid that DbException should be the ...

How to prevent that a channel exception make a WCF service stop working?

I created a WCF singleton service with netNamedPipeBinding. When a channel exception occurs, it leaves a channel in a faulty state, and all subsequent operations throws exceptions. How can I prevent this? I want that a TimeoutException, or any of the other common exceptions, to make only one operation fail, and not to make the service un...

Where does execution resume following an exception?

In general, where does program execution resume after an exception has been thrown and caught? Does it resume following the line of code where the exception was thrown, or does it resume following where it's caught? Also, is this behavior consistent across most programming languages? ...

sys.web.forms.page.request manager PaserError exception

hai friends <%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" MasterPageFile="~/Transaction.master" CodeFile="TJFAS109.aspx.cs" Inherits="TJFAS109" %> <%@ Register TagPrefix="Teja" TagName="DateTime" Src="~/UserControl/DateSelector.ascx" %> function GetValueTJFS109() { __doPostBack('',''); } .......

Catching Exceptions Syntax Error in PHP

I'm trying to use exceptions in PHP as a way of avoiding multiple if-then-else blocks. However, when I try to catch the exception, I get the error Parse error: syntax error, unexpected T_CATCH in /directory/functions.php on line 66. Am I doing something wrong with my throwing and catching? function doThis($sSchool, $sDivision, $sClass, ...

NetBeans PHP does not break on exception

I'm trying to debug some PHP using NetBeans PHP 6.8 with XAMPP on Windows and setup xdebug in php.ini. The step by step seem working fine but when there is a critical exception on the website in the PHP, NetBeans doesn't break on it. I heard about adding a break-point on Exception but I couldn't find it in NetBeans 6.8. The Ctrl + Shift...

What exception to raise if wrong number of arguments passed in to **args?

Suppose in python you have a routine that accepts three named parameters (as **args), but any two out of these three must be filled in. If only one is filled in, it's an error. If all three are, it's an error. What kind of error would you raise ? RuntimeError, a specifically created exception, or other ? ...