exception

Does an exception inside a TRY block break its execution?

I'm importing several fields, and that is, about 25 lines of code each importing one field (in my case, there's really no other way). It's in a try-catch block, but there are some times, that this field doesn't exist in the source, but I have to get the rest. from 20. I get 10 the 11th one doesn't exist (exception) I still need from 12 ...

How to handle a static final field initializer that throws checked exception

Hello all, I am facing a use case where I would like to declare a static finalfield with an initializer statement that is declared to throw a checked exception. Typically, it'd look like this: public static final ObjectName OBJECT_NAME = new ObjectName("foo:type=bar"); The issue I have here is that the `ObjectName` constructor may thr...

Validation of .NET assemblies in C#?

How do you check if a assembly loaded is a valid .NET assembly? I currently have this code but unmanaged DLL's throw a BadImageFormatException. string[] filepaths = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.dll", SearchOption.AllDirectories); List<Type> potentialEffects = new List<Type>(); foreach (string f...

Linq2SQL: "Transaction (Process ID 56) was deadlocked on lock resources with another"

I have a process that (at night) take a large chunk of data in the form of a linq2sql query and dumps this as XML (sitemaps). My problem is that I'm sometimes is getting: System.Data.SqlClient.SqlException: Transaction (Process ID XX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun...

Select query causing exception

When does the below sql function can cause an exception other than NO DATA FOUND? v_ExchangeRate is of type float.The datatype of rate column is NUMBER(14, 10) and this column can not contain NULL values. BEGIN SELECT rate INTO v_ExchangeRate FROM exchange_rate WHERE currency_code = CurrencyCode AND status = 'A'; The data type ...

Implementing python exceptions

I'm having some problems implementing an exception system in my program. I found somewhere the following piece of code that I am trying to use for my program: class InvalidProgramStateException(Exception): def __init__(self, expr, msg): self.expr = expr self.msg = msg I think msg must be a string message to be show...

How to Catch Exceptions in WPF when Calling a WCF Sevive

How to Catch Exceptions in WPF when Calling a WCF Sevive ...

Django 1.1 - comments - 'render_comment_form' returns TemplateSyntaxError

Hello, I want to simply render a built-in comment form in a template, using Django's builtin commenting module, but this returns a TemplateSyntaxError Exception. I need help debugging this error, please, because after googling and using the Django API reference, I'm still not getting any farther. Info: This is the template '_post.htm...

Count Parenthesis in a file with a Python program?

I Wanna fix a function through it i can count how many times are used the:(,),[,] if the counts of ( are equal to those of ) and if the counts of [ are equal to those of ] then i have valid syntax! my first -dissapointed- try: filename=input("Give a file name:") def parenthesis(filename): try: f=open(filename,'r') exc...

How to Determine The Module a Particular Exception Class is Defined In

Note: i edited my Q (in the title) so that it better reflects what i actually want to know. In the original title and in the text of my Q, i referred to the source of the thrown exception; what i meant, and what i should have referred to, as pointed out in one of the high-strung but otherwise helpful response below, is the module that t...

building excel file gives memory out of exception

Hi, I need to export huge amount of data from ado.net datatable(which i get by db query) to excel. I tried the following way : 1. Create excel object with workbook/worksheet @ server side...and use memory stream to write whole document to client side. But this gave me "out of Memory exception". bcoz my memory stream was was so huge. ...

excel export Memory exception

Hi, I need to export huge amount of data from ado.net datatable(which i get by db query) to excel. I tried the following way : 1. Create excel object with workbook/worksheet @ server side...and use memory stream to write whole document to client side. But this gave me "out of Memory exception". bcoz my memory stream was was so huge. S...

Exception on ExecuteNonQuery method about unsuccessful value convertion

i am using OleDbCommand.ExecuteNonQuery() to insert data into the database: ObjCommand = New OleDbCommand ObjCommand.CommandType = CommandType.StoredProcedure ObjCommand.CommandText = StrSQL ObjCommand.Parameters.Add("field1", OleDbType.VarChar).Value = <something1> ObjCommand.Parameters.Add("field", OleDbType.VarChar).Value = <somethi...

Is it reasonable to catch an exception based on the message?

I want to gracefully handle a specific exception with a certain message. Unfortunately, it's just an ArgumentException, and not specific to what I'm looking for. In this case, the message is "An item with the same key has already been added". This IS an exceptional case, but I want to handle it so that I can either turn it into a specifi...

Module with handle [xxxx] and index [x] has no application entry point

I'm having a problem with calling: HomeScreen.updateIcon(_Icon); or HomeScreen.setName("${app.title}"); This throws an exception "Module with handle [xxxx] and index [x] has no application entry point". Only when the application is first installed, but not subsequent reboots. What's wrong with .updateIcon()? ...

How slow are Python/django exceptions?

is python exception slow? I'm kind using python exceptions to structure programm follow in my web application, and I'm wondering how throwing exceptions will affect performance of my application. what is your thoughts? which one of the following statements is less expensive in terms of memory and cpu? try: artist = Artist.objects....

Why does my program terminate when an exception is thrown by a destructor ?

I am not getting why if there is an active exception then if an exception is raised again, it leads to termination of program. Could someone explain? ...

C#: Overriding ToString() method for custom exceptions

I have a custom exception class which contains some additional fields. I want these to be written out in the ToString() method, but if I implement my own ToString(), I loose some other useful stuff (like writing the exception type name, the inner exception data and the stack trace). What is the best way/pattern to implement your own To...

Is it possible for one WCF session to throw an exception in another session?

if an administrator logs on to my service, he may wish to disconnect sessions which meet (or don't meet) certain requirements, be it automated or manual. throwing exceptions seems like a simple and effective solution, as all resources are released. i could use a local bool field which, if true, would disconnect this user the next time h...

SQL error: String or binary data would be truncated

I'm doing an integration on a community platform called Telligent. I'm using a 3rd-party add-on called BlogML to import blog posts from an XML file (in BlogML format) into my local Telligent site. The Telligent platform comes with many classes in their SDK so that I can programmatically add content, such as blog posts. E.g. myWeblogServ...