I know that I shouldn't throw exceptions from a destructor.
If my destructor calls a function that can throw an exception, is it OK if I catch it in the destructor and don't throw it further? Or can it cause abort anyway and I shouldn't call such functions from a destructor at all?
...
I have a method that A) inserts a row in a table and then B) uses the resulting Identity value in several inserts in another table. If the logic in part B fails for any reason, I need to rollback all of the inserts for both parts B and A. I'm fairly certain that transactions would not work for this, although I'm open to being persuaded...
Hi
I have a textbox which i applied on it jq wysiwyg:
public static void PopulateWysiwyg(this SafeTextBox tb)
{
string script =
@"
jQuery(document).ready(function()
{
jQuery('#safe_text_box').wysiwyg();
});
";
ScriptManager.RegisterStartupScript(
tb,
tb.GetType(),
tb.ClientID + "_wysiwyg",
...
I have an application that consists of managed and unmanaged
DLLs. My managed DLL is a C++/CLR DLL that is used to access
a native C++ DLL. When code crosses from managed to native
the logic is wrapped in a try/catch statement. The purpose
is to log any exceptions before we rethrow them.
C++/CLR code calling into native code.
try
...
I have a simple custom exception defined like like the following but I don't like having to use the Throw function and I really don't like having both Throw and a Throw2 functions. Is there a more elegant way of doing this? Is there a way of throwing MyError or Error directly without the intermediate function?
#light
module Utilities.M...
The following code when executed on certain machines in our company causes an IllegalArgumentException to be thrown:
Color sludge = new Color(133, 133, 78);
//throws IAE with message "Color parameter outside of expected range: Red Green Blue"
An equivalent call using float arguments instead works:
Color sludge = new Color(0.522, 0.52...
We use Native COM support in our code havily. Everything's fine except that we don't like the fact that on error _com_raise_error() is called which throws a _com_error exception. Since we have our own hierarchy of exceptions catching this _com_error is inconvenient - it's not in our hierarchy and even doesn't inherit from std::exception....
Is it possible to throw an Exception from the Completed event of an Async action?
My situation is that I'm using a WebClient class and executing an async download. If an error is encountered then I can retrieve this via the AsyncCompletedEventArgs of the WebClient.DownloadFileCompleted event.
However what I really want to do, is then t...
When I register the following in SM and then attempt to create an instance I get the exception - 'StructureMap Exception Code: 202 No Default Instance defined for PluginFamily...'
Scan(x =>
{
x.Assembly("MVCDemo");
x.Assembly("MVCDemo.Infrastructure");
x.Assembly("MVCDemo.Services");
...
I'm trying to raise an exception on the Server Side of an SimpleXMLRPCServer; however, all attempts get a "Fault 1" exception on the client side.
RPC_Server.AbortTest()
File "C:\Python25\lib\xmlrpclib.py", line 1147, in call
return self.send(self.__name, args)
File "C:\Python25\lib\xmlrpclib.py", line 1437, in __request
verb...
I identified a bug in my code and I'm baffled as to how it could have occurred in the first place.
My question is, I found a skip in the database ID fields (it is an incremented identity field), indicating some records weren't inserted - which means my SQL sprocs (probably) threw an error. Thinking backwards from there, that means that ...
Hi--I'm fairly new to python and following along with part 4 of the tutorial for the Django framework here. I'm trying to implement generic views for the polls app--my code seems correct (as far as I can tell), but when I try to vote, I get a NoReverseMatch Exception that states:
Reverse for 'polls/poll_results' with arguments '(1L,...
Does .NET has an Exception that similar to Delphi's EAbort ?
Currently, define my own "AbortProcess" inheriting Exception.
Together with My.Application.UnhandledException handler that ignoring "AbortProcess"
I'm still wondering if similar mechanic in .NET is already exists.
Class AbortProcess
Inherits System.Exception
End Class
Su...
Hi guys,
I'm new at Spring, so I put Spring 3.0M3 on a Tomcat server on my Mac, made an Eclipse project, completed a Hello World and then wanted to make an object persist with Hibernate. I've made a User table on my MySQL server, made a User object with all getters and setters (I really wish Java would take a queue from Objective-C here ...
I'm getting this exception when running some code to add text to a Lucene.net index:
The process cannot access the file
'E:\SomeProject\SomeProject.Webroot\App_Data\Lucene\segments.new'
because it is being used by another
process.
What's the easiest way of finding out what the 'other process' is? (I'm running on Win XP) Here'...
I have a situation where I've wrapped a Native C++ DLL with C++/CLI for eventual use in C#.
There are a few callback functions that are causing some issues at run time. Particularly, I get the following exception:
An unhandled exception of type
'System.Runtime.InteropServices.InvalidOleVariantTypeException'
occurred in ToadWra...
Here's what's going on. I'm opening a file on FTP that exists using a WebClient. The file exists and the function has worked in the past, but now for some reason throws an exception. (System.Net.WebException: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).). The funny thing is, the script st...
Consider the following Python exception:
[...]
f.extractall()
File "C:\Python26\lib\zipfile.py", line 935, in extractall
self.extract(zipinfo, path, pwd)
File "C:\Python26\lib\zipfile.py", line 923, in extract
return self._extract_member(member, path, pwd)
File "C:\Python26\lib\zipfile.py", line 957, in _extract_memb...
Everyone here should know the 'or' statemens, usually glued to an die() command:
$foo = bar() or die('Error: bar function return false.');
The most of the times we see something like:
mysql_query('SELECT ...') or die('Error in during the query');
However, i cant understand how exactly that 'or' statement works.
I would like to thr...
why this line:
var category = _dataContext.Categories.Where<Category>(p => p.Keywords.Split(' ').Contains<string>(context.Request.QueryString["q"])).First();
throws an System.NotSupportedException:
Comparison operators not supported for type 'System.String[]'
And how can I fix it?
Thanks.
...