If I'm writing a class library, and at some point in that library I have code to catch an exception and deal with it, then I don't want anyone using my library to know that it even happened - it should be invisible from the outside world.
However, if they have "Catch Thrown Exceptions" turned on in Visual Studio (as opposed to "Catch Us...
I have a windows forms client that consumes an ASP.net web service.
It's my understanding that when an exception is thrown by the web service it will be converted to a SoapException in the .net client software.
Well, I am catching the SoapException, but when I display the message on the client end in a messagebox, it shows more informa...
Hi
I am looking for the best way to do exception handling, for example.. when an error occurs in the business logic layer, is the best way to stop the METHOD using a catch and return an EVENT to the presentation layer?
What should this event contain?
Or should i always BUBBLE up exceptions and handle them in the presentation layer?
...
Hello,
I have the following code in a class of mine. The purpose of this class is to get the balance from a web server. Just in case something goes wrong with getting the balance. I will handle a exception. However, all this is easy to do. But I am left wondering what do I return in my catch statement.
Most of the examples I looked at...
Hi,
I was going through the Programming Ruby book and Im having problem understanding the following concepts:
The authors talk about "transient exceptions" that may occur in the code and then suggest a creation of your own exception object to handle them. I dont think i fully understand what a transient error is and when is it appro...
Hello,
This is the code I use to setup my TCP server
internal void Initialize(int port,string IP)
{
IPEndPoint _Point = new IPEndPoint(IPAddress.Parse(IP), port);
Socket _Accpt = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
try
{
_Accpt.Bind(_Point);
...
We are using the Enterprise Library 4.1 Exception Handling Application Block's ExceptionShielding feature in combination with a custom RoleProvider with our WCF services. When the RoleProvider determines an user is not in a role and returns false from the IsInRole method, the following exception is occurring:
System.ServiceModel.Securi...
I wonder, How exception handling mechanishm actualy works in .net?
Just want to know, what happens in runtime internally?
...
Other than reading the GetFileName() file and reading to line GetFileLineNumber() of a stackframe from
new StackTrace(exception).GetFrame(x)
is there a way to get the actual line of code (as a string) which caused an exception?
Thanks
...
I have to implement a IExceptionHandler for the Enteprise Library 4.1. In my particular case I want to use it to log the exception to Fogbugz but the inner details is not what I am asking about. What I need is how to - best practicies - implement it, How to get the config for a app.config or web.config. etc.
I have code This so far:
...
Hi guys,
i'm writing a dll which is a wrapper to a access database. and i'm pretty new to c# in general as my background is in web development LAMP with perl, i'm not sure what's a good way to return error to a calling app in case they pass the wrong parameters to my functions or what not.
I have no idea as of now except to probably do ...
I am trying to throw a (custom) ImportException from the method importUsers in class UserHelper. I can see in the debugger that the throw clause is executed, but the method, from which the importUsers method is called, never catches the exception.
Here is the method, where the exception is thrown:
public static AccessorValidator impor...
For example, many methods in frameworks/JDK might throw
java.lang.SecurityException
but this is not indicated in the method signature (since that is a practice normally reserved for checked exceptions).
I want to argue that declaring RuntimeExceptions in method sigs has many benefits (akin to static type checking for example). Am I d...
Is there any point in having a com.myco.myproj.MyProjRuntimeException,
which completley extends RuntimeException?
...
I am taking on a project where all the Exceptions have been placed in a separate package com.myco.myproj.exceptions.
Is this good practice?
...
I'm importing a module which raises the following error in some conditions:
RuntimeError: pyparted requires root access
I know that I can just check for root access before the import, but I'd like to know how to catch this spesific kind of error via a try/except statement for future reference. Is there any way to differentiate betwe...
I'm developing a project on google app engine (webapp framework). I need you people to assess how I handle exceptions.
There are 4 types of exceptions I am handling:
Programming exceptions
Bad user input
Incorrect URLs
Incorrect query strings
Here is how I handle them:
I have subclassed the webapp.requesthandler class and overrode...
Imagine I have a service that looks like this:
public interface MyAccountService
{
boolean create( String user );
}
The method create performs several changes, namely (for discussion sake):
adds a message into a Queue
adds a row into several tables
creates a LDAP account etc...
Currently I collapse all the error messages into ...
Hi,
I need to consume data from a webservice. I am receiving xml data and using this to create objects through property setters.
In one particular case, an attribute of the object (called "is_active" and indicates whether the object is active or inactive in the application) is represented sometimes by
<field type="BooleanField" name="...
In the j2ee applications I plan on standardizing the exception handling strategy. No more swallowing exceptions and basically converting all checked exceptions into unchecked (except for some that actually can be recovered from. The standard will be that all Exception will be thrown back up to the container (eg: http://www.onjava.com/pub...