My chat application connects to a server and information is sent/received by the user. When the connection changes, such as 3g->wifi, wifi->3g, losing a data connection, etc, the socket sometimes stays connected for ages before disconnecting. During this time, it's impossible to tell if the connection is still active, it seems as if mess...
Hi all,
I'm doing an iPhone app that reads data from XML file, turn them into Core Data Managed Objects and save them.
The application is working fine, mostly, on smaller data set/XML that contains ~150 objects. I said mostly because 10% of the time, I'd get the following exception from CoreData while trying to save the context:
* Te...
I hate writing error condition code. I guess I don't have a good approach to doing it:
Do you write all of your 'functional'
code first then go back in and add
error handling or vice versa?
How stupid do you assume your users
are?
How granular do you make your
exception throws?
Does anyone have sage advice to pass on to make this ea...
Hello,
How can I catch an error in devenv? If an error occures (the build fails..) I need to print it out. How can I do that? Thanks!
...
So I am using HtmlUnit, and the method's signature looks like:
public HtmlAnchor getAnchorByText(String text)
throws ElementNotFoundException
So this means, the call to this method won't just return null, but it will throw an exception.
(I find this a pain!!, in c# methods usually just return a null if not ...
I am new to exceptions, haven't covered them in college yet so still learning about them. I tried this and it seems to work, but doesn't seem "right". What's the correct way to try a method again after a exception has been handled?
public static void openCSV(String file) {
FileInputStream fis;
try {
fis = new FileInputS...
All of my NH entities derive from a type called BusinessEntity, it
has the most basic values ID, Created, CreatedBy, Updated, UpdatedBy.
CreatedBy / UpdatedBy takes a User
I have a IPreUpdateEventListener and IPreInsertEventListener that fire
to get the current DateTime for the audit values. Also in here I have
my logic to get the curr...
[Edit: (copied from a comment) As it turns out, the problem was elsewhere, but thank you all for your input.]
I have a shared container class which uses a single mutex to lock the push() and pop() functions, since I don't want to simultaneously modify the head and tail. Here's the code:
int Queue::push( WorkUnit unit )
{
pthread_mu...
I'm not that new to Java. I've done plenty of stuff with it before. But I'm migrating from PHP to Java Servlet/JSP (which I am new to) and I can't figure out this error to save my life. I installed Tomcat6 using Ubuntu 9.04's Synaptic Package Manager and it works like a charm. But when I put struts in my WEB-INF/lib directory and try to ...
Are there any unclear side effects to throwing an exception from within a synchronized clause?
What happens to the lock?
private void doSomething() throws Exception {...}
synchronized (lock) {
doSomething();
}
...
Has anyone got any experience with the following exception when using GAE urlfetch?
DownloadError: ApplicationError: 2 timed out
I'm trying to send a HTTP POST request. Like so:
result = urlfetch.fetch('http://api.nathan.com:8080/Obj/',
method='POST',
payload=pos...
What is the general way of handling complex results from functions with an object? A simple method might return true or false, and that would be all I need to know. A more complex method might return true or false, but there might be more information I would want to get out of the class, such as why it failed ( there might be several rea...
import httplib
def httpCode(theurl):
if theurl.startswith("http://"): theurl = theurl[7:]
head = theurl[:theurl.find('/')]
tail = theurl[theurl.find('/'):]
response_code = 0
conn = httplib.HTTPConnection(head)
conn.request("HEAD",tail)
res = conn.getresponse()
response_code = int(res.status)
return res...
My application can run in 2 modes first one instantiates itself after going into main() enters event dispatcher then works as normal.
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
In another (used to update some background stuff) it does not enter into event dispatcher just runs an http request and does some extra stuff.
...
I'm getting an error in a program that is supposed to run for a long time that too many files are open. Is there any way I can keep track of which files are open so I can print that list out occasionally and see where the problem is?
...
Hi there.
I'm trying to remove a item from a ArrayList and I get this Exception:
Collection was modified; enumeration operation may not execute.
Any ideas? thanks for the help
...
In my ASP.NET (3.5) application, I don't have global exception handling, and if an unhandled exception is thrown, instead of getting the standard yellow ASP.NET error, I'm getting a bunch of junk characters (fairly long, and different each time) - stuff like:
y6����h����H'��:���ղ�>�Ey�裟��Y��>:�O���b�>ZV�"+壦�A�(?��Ӫ��G�2��=�%�w�@}
Obvio...
I have the following code:
try
{
mainSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, serverPort);
mainSocket.Bind(ipEndPoint);
mainSocket.Listen(MAX_CONNECTIONS);
mainSocket.BeginAccept(new AsyncCallback(serverEndAccept), mainSocke...
Some of the analytics packages (for instance, Flurry) will listen for Exceptions and log them w/o actually catching them. How are they doing this?
...
How can I know what exceptions might be thrown from a method call?
...