Hi,
I think it's a design question, and it's been haunting me since I started my project.
I'm working on a project involving a lot IO operations, mainly reading and writing files.
I'm trying to use MVC (Model-View-Controler) architectural strategy, but I found it's very difficult to implement, especially with the exception handling.
...
My application's persistence layer is formed by a Storage trait and an implementing class. I'm vacillating on this issue: should the fetchFoo(key: Key) methods should return Option[Foo], or should they throw FooNotFound exceptions if the key cannot be found?
To add flavour to the issue, the persistence layer - it is written in Scala - i...
I've noticed that JSF 1.2. does not return error page when an exception was thrown in actionListener method but does return error page when an exception was thrown in action method. Why is that? Can it return error page in both cases?
...
I am building a proof of concept on a new box that has been set up with Windows Server Standard running IIS 7.
The task I need to do is take the logged in user and using Office Communicator 2007 check for the presence (and type of presence, online, offline, away, busy etc) of other users on the exchange box on the same machine.
The cod...
Is there any PHP library for handling exceptions/errors(including fatal) in PHP? It should be very configurable, support log to file, send Emails, and have integration with different browsers console.
...
Environment:
Client: JavaME, CDC/Foundation 1.1 with JSR-172 client library. Service stubs created with Sun WTK 2.5.2.
Server: JBoss 3.2.8SP1 (don't ask, cannot be changed) with Axis2.war providing the webservices
Problem:
In the JavaME based program a background thread calls a webservice on the remote JBoss host. Depending on user...
I have a method like...
int f() {
try {
int i = process();
return i;
} catch(Exception ex) {
ThrowSpecificFault(ex);
}
}
This produces a compiler error, "not all code paths return a value". But in my case ThrowSpecificFault() will always throw (the appropriate) exception. So I am forced to a put a return value at t...
>> url = 'https://test.authorize.net/gateway/transact.dll'
>> data = {'x_login': 'abc123', 'x_type': 'AUTH_CAPTURE', 'x_card_num': '4444333322221103', 'x_amount': '50.75', 'x_tran_key
': 'abc123', 'x_version': '3.1', 'x_delim_char': '|', 'x_exp_date': '022012', 'x_delim_data': 'TRUE'}
>>
>> urllib2.urlopen(url, data)
Traceback (most rec...
Whenever I define a new exception, I tend to do one of two things:
Create an exceptions file which contains a listing of all the new exceptions defined in my project.
Put each defined exception in the same file as the class in which it is thrown.
Netbeans doesn't doesn't like it when I have a public exception defined in the same file...
im getting this nasty exception, the problem is that i cannot control the get string since it's done by a 3rd party app. Apparently the number is too long to be parsed as int...
java.lang.NumberFormatException: For input string: "1286579871769"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at j...
Been trying to change my code all around to catch the exceptions but can't figure out how to go about it with this one. I run into double instantiation of the JOptionPane from time to time too depending on where I put it.
import java.awt.Font;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public ...
I am adding a validation rule to a textbox (following examples on WPF 4 Unleashed by Adam Nathan)
When starting an application, I am faced with the following cryptic error message
Provide value on 'System.Windows.Data.Binding' threw an exception
What does the error mean and what needs to be done to address the problem?
Here is...
I have to interface with some C code from C++ class constructor (Intel library)
class A{
A{
x = ippiMalloc();
if(x==NULL) ...
}
}
In the constructor malloc function (intel version) is used. If ippiMalloc function do not succeed what is the correct way to handle it. Throw exception?
...
I am doing a project where I have to generate some logs[which are text files]. I am generating the logs by a thread [thread is essential] to application data folder. But vista does not giving me access and throwing an exception "access denied". I am very much confused. Any suggestion will be very helpful. Thanks.
...
Can anyone tell me a code for next function, which raises EXCEPTION_FLT_STACK_CHECK or EXCEPTION_BREAKPOINT, for I could catch them in main func:
int _tmain(int argc, _TCHAR* argv[])
{
__try
{
FaultingStack(); // What I need to write in this function???
}
__except(GetExceptionCode() == EXCEPTION_FLT_STACK_CHEC...
class Collector
class ContentNotFound < Exception
end
class DuplicateContent < Exception
end
end
begin
raise Collector::ContentNotFound.new
rescue
puts "catch"
end
When I run the script I don't get "catch" message I see error:
lib/collector/exception.rb:10:in `<main>': Collector::ContentNotFound (Collector::ContentNotFou...
Hi,
I have a client server app which uses .NET Remoting to communicate. This is separated by an interface and the client doesn't reference the server's implementation. Now, a custom exception in a shared dll, when thrown from the server isn't caught by the client and throws a TargetInvocationException saying "Could not load the file or ...
I tend to write code like the following a lot:
BufferedWriter w = null; // Or any other object that throws exceptions and needs to be closed
try {
w = new BufferedWriter(new FileWriter(file));
// Do something with w
} catch (IOException e) {
e.printStackTrace();
} finally {
if (w != null) {
try {
w.cl...
Hi guys,
I am getting very annoying message called "system.outofmemory.exception" while I do have a lot of unused memory in my laptop. Unless I closed and re-opened the solution, it won't letting me to continue my work.
Is there any configuration or service pack that can fix the issue ?
Thanks
...
I have been completely puzzled by an issue I just came over in my Java application.
When I attempt to run the code given below, Java raises a ConcurrentModificationException on the line that says "if ( this.vertexStore.get ( v ).addAll ( output ) )".
I find this very strange considering this a completely single-threaded application, a...