I'm working on an API wrapper class, which is the first I've made. For the most part it hasn't been too difficult. Getting to the point where I need to deal with the potential of errors being returned by the API, however confused as to how I should go about dealing with them.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Tuesday, May 15, 2012
When should I throw an exception as opposed to return an error in PHP?
Wednesday, April 25, 2012
Try-catch-finally and then again a try catch
I have often come across situations like :-
try{
...
stmts
...
}
catch(Exception ex) {
...
stmts
...
} finally {
connection.close // throws an exception
}
Tuesday, April 3, 2012
Try-catch exception handling practice for iPhone/Objective-C
Apologies if this question has already been answered somewhere else, but I could not find any decisive answer when searching on it:
Tuesday, February 28, 2012
Why this null pointer exception when using BufferStrategy with swing timer in Java?
Why might I be getting the following exception with the below code?
Saturday, February 25, 2012
Filereader null declarations and appending best practice
I want to optimise my file reader function but am not sure if it is best practice to declare the nulls outside of the try loop. Also, is looping and appending chars to a Stringbuffer considered bad practice? I would like to use the exception handling here, but maybe it is better to use another structure? any advice most welcome, thanks.
Thursday, February 16, 2012
Alternative solutions for android.os.NetworkOnMainThreadException
Now I'm solving the
android.os.NetworkOnMainThreadException
I put the connect method into separated thread, but when the thread starts, the start() method doesn't invoke the Run() , - and also using the AsyncTask , the task doesn't invoke the doInBackground() method!
Wednesday, February 8, 2012
iPhone - How to test allocated objects returned by each memory call?
When writing an app, you always have to write alloc/inits, get autoreleased datas returned by the framework classes, ...
Sunday, January 29, 2012
Distinguish new vs existing exceptions
I am creating a PHP application and I want to display the number of times an error has occurred. The problem that I am trying to figure out is if an error has already been reported or if its new using the following values: