What is the purpose of having so many types of exceptions in .net? Why not just use Exception?
Some of them are EndOfStreamException, FileLoadException, FileNotFoundException, IOException, InvalidTimeZoneException......
...
I'm using VS Unit Testing Framework and Moq.
When a Moq verification fails, I'll get a Moq.MockException. In the Test Results window, instead of showing the helpful message inside the exception, it just says "Test method XXX threw exception: ..."
Is there a way to tell the VS Unit Test framework always display the message of exceptions...
In the Zend Framework library, the current practice (circa 1.10.8) is that library components throw exceptions that extend Zend_Exception.
E.g. the Zend_Layout component throws a Zend_Layout_Exception
In my own ZF library, where I'm adding my own ZF components or extending existing components, I'm throwing a Mylibrary_Exception (it's...
Hi all,
I have a Ria service to call logic code. I want to write try catch block in every logic funtion to provide ways to handle unhandeled exceptions.
try
{
//something
}
catch(BussinessException e)
{
//save e.info to database
}
But I don't want to write this block code everywhere in my logic, and I don't want to put the exception ...
Is it possible to remove the trace elements from the __toString.
What I want is something like this.
class DBException extends PDOException
{
public function __toString()
{
return get_class($this) . " '{$this->getMessage()}' in {$this->getFile()}({$this->getLine()})\n";
}
}
I've tried the above method but it doesn't seem to work....
Hi,
this question is about how to create useful log information in a .swf that should be send to a serversided log.
I have read http://stackoverflow.com/questions/101532/how-to-catch-all-exceptions-in-flex
and was very happy about the new UncaughtErrorEvent.
But it is not as useful I thought first: You can not get a stack-trace out of...
The following freemarker code causes an exception
<#assign i= it.getList().size()>
<#list it.getList() as elem>
<#if i==1>
<li>${elem.name}</li>
<#else>
<li class="marked">${elem.name}</li>
</#if>
<#assign i = i-1>
</#list>
The following exception is thrown:
Expected hash. it.getList() evaluated instead to ...
I've written a simple web servrice application in Delphi using THTTPSoapDispatcher and THTTPSoapPascalInvoker. Everything works ok, except that I don't understand how to handle exceptions. So whenever an exception occurs inside the service method, the following SOAP response is generated:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:S...
For some reason Visual Studio 2008 doesn't always stop when an exception occurs to report the exception when I am Debugging. Sometimes it just jumps up an arbitrary number of frames in the stack and continues on with program execution. This results in bugs that are very difficult to resolve. Frankly, its rather annoying. I want to kno...
Hi
I am working on a case where I need to clean invalid XML characters I receive from a SharePoint web service.
I know fixing the source is the right thing to do - however this issue has been reported back in 2008, and I have yet to find that Microsoft has released a patch for it.
For now, I call the Web Service using the Provider inte...
All,
I am getting this exception
com.jscape.inet.ftp.FtpException: bad line length
at com.jscape.inet.ftps.FtpsClient.(Unknown Source)
at com.jscape.inet.ftps.FtpsClient.createUnprotected(Unknown Source)
at com.jscape.inet.ftps.Ftps$DefaultStrategy.createClient(Unknown Source)
at com.jscape.inet.ftps.Ftps.connect(Unknown Source)
at...
My work place has imposed a rules for no use of exception (catching is allowed). If I have code like this
def f1()
if bad_thing_happen():
raise Exception('bad stuff')
...
return something
I could change it to
def f1()
if bad_thing_happen():
return [-1, None]
...
return [0, something]
f1 caller would be like this
d...
When I opened a VC6 project in VS2008 and tried building it , initially I got the error:
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
error C2259: 'CException' : cannot instantiate abstract class
error BK1506 : cannot open file '.\Debug\SClientDlg.sbr': No such file or directory ...
I've purchased a third party library that I am using from my application. My application references a small interop dll which in turn calls into another dll (non CLI) to do its thing. Since this library communicates with hardware, I'd image that this dll talks with various device drivers.
A typical method signature from the interop dl...
I have a project which uses STL a lot. Now I'm working on porting the project to a specific platform which doesn't support exceptions. I can disable exceptions, however I still need to handle STL errors.
Is there any approach to handle STL errors correctly with exceptions disabled? Is there any third party STL implementation which helps...
Today I encountered the following situation: ("pseudo code")
class MyClass {
public void workOnArray(Object[] data) {
for (Object item : data) {
workOnItem(item);
}
}
public void workOnItem(Object item) {
if (item == null) throw new NullPointerException();
}
}
Now if the caller cal...
The Google App Engine UrlFetchService has a setDeadline FetchOption which is suppose to raise an exception when tripped.
The app can specify the maximum amount of time to wait when it makes the call. If the maximum wait time is exceeded, the call raises an exception.
Which Exception?
If it is an IOException, how should I discrimi...
We have a Webstart client that communicates to the server by sending serialized objects over HTTPS using java.net.HttpsURLConnection.
Everything works perfectly fine on my local machine and on test servers located in our office, but I'm experiencing a very, very strange issue which is only occurring on our production and staging servers...
What is in my velocity.properties file
resouce.loader = string
string.resource.loader.description = Velocity StringResource Loader
string.resource.loader.class = org.apache.velocity.runtime.resource.loader.StringResourceLoader
#string.resource.loader.repository.class = org.apache.velocity.runtime.resource.loader.StringResourceRepository...
I am doing little hobby project in C#, a language I do not know well, and have stumbled upon the following:
Suppose you have an asynchronous operation implemented by using BackgroundWorker. Now if there is an exception, event RunWorkerCompleted will be raised and RunWorkerCompletedEventArgs.Error will be non-null.
Is the following the ...