179 Topics

Member Avatar for
Member Avatar for Violet_82

Hi guys, I have a question about error handling. Still working on the addition application and now that I've learned what are the correct exceptions to handle I'm not sure what to do when I've established that the my inputs are all valid and print my result. Let's have a …

Member Avatar for Gribouillis
0
413
Member Avatar for ogsirus

Hi Guys I ran into a bit of a problem with some code I am writing. I am trying to store all possible combinations of a set of numbers which are current being stored in List. Problem is my code run into an out of memory exception, heres my code: …

Member Avatar for ogsirus
0
2K
Member Avatar for achava

As part of a class in Java, the constuctor is supposed to throw a java.lang.IllegalArgumentException exception when an integer that is a field in the class, let's call it int N, is set to a negative vale. How do I set this up?

Member Avatar for achava
0
214
Member Avatar for mjbor1

i developing a poster software, when i'm trying to post a link it give the following exception facebook api exception #100-invalid here's my code public static bool post(string accesstoken,string status,string link) { try { FacebookClient fb = new FacebookClient(accesstoken); Dictionary<string, object> postArgs = new Dictionary<string, object>(); postArgs["message"] = status; if …

Member Avatar for mjbor1
0
1K
Member Avatar for cd88

Hi, I am trying to use an exception catch properly but I am getting lost and frustrated. I've changed my code so many times and cannot figure out why when it catches the exception it will not let me continue to enter data into the array. It just displays it …

Member Avatar for JamesCherrill
0
232
Member Avatar for moaz.amin.37

hello i am doing my assignment on simple calculator in java.Now I want to handle exceptions in it. so i need some information about exception for exemple a user enter any expression like `(10+23+56-55)` it is corrent formate but when the user enter wrong formate like `(20++56//5)` i mean operator …

Member Avatar for BenWard
0
406
Member Avatar for moaz.amin.37

Exception message is not showing import java.util.*; class WrongException extends Exception{ public WrongException(String s){ super(s); } } public class UserDefinedException2{ public static void main(String s[]){ int a,b; a=b=0; Scanner ob=new Scanner(System.in); System.out.print("Enter your age = "); a=ob.nextInt(); try { if(a<=0) throw new WrongException("age cannot be zero or nagetive"); System.out.print("age = …

Member Avatar for Akansha Jain
0
2K
Member Avatar for moaz.amin.37

if a program throw 2 exceptions can we handled it by user defined exception.for example import java.util.*; class WrongException extends Exception{ public WrongException(String s){ super(s); } } public class UserDefinedException2{ public static void main(String s[]){ int a,b; a=b=0; Scanner ob=new Scanner(System.in); System.out.print("Enter your age = "); a=ob.nextInt(); try { if(a<=0) …

Member Avatar for JamesCherrill
0
250
Member Avatar for moaz.amin.37

Following exceptions are `Checked Exception` or `Unchecked Exception` ArrayStoreException IllegalArgumentException

Member Avatar for JamesCherrill
0
283
Member Avatar for moaz.amin.37

exception is a run time error,then why exceptions are again classified into compile time exception and run time exception,in that case it should be run time exceptions only.please give explanation with suitable real time example

Member Avatar for moaz.amin.37
-1
328
Member Avatar for Riteman

I recently developed an application and it successfully ran in my computer where I developed. But when I tried to run in my client's system, it returns: An unhandled microsoft .net framework exception occurred in Members Manager.exe [2916] The number in the square braces appears randomly. I can't figure out …

Member Avatar for Riteman
0
261
Member Avatar for Patrick_3

Hello, I am experiencing a very unusual problem. If an exception occurs within my Frm_Load method which handles MyBase.Load, the method simply ends, a nice message is printed to the debug windows explaining the error, and program execution continues. The problem is, I want an error in the Load method …

Member Avatar for PerplexedB
0
237
Member Avatar for kannan mangalar

if (!empty($_POST['twitnam'])) { $message = $_POST['message']; $TwitterUsername = $_POST['twitnam']; $tw_sql = mysqli_query($connection, "SELECT oauth_token,oauth_token_secret FROM TwitterUpdate WHERE uname='$TwitterUsername'"); $row = mysqli_fetch_array($tw_sql, MYSQLI_ASSOC); $oauth_token = $row["oauth_token"]; $oauth_token_secret = $row["oauth_token_secret"]; if (strlen($oauth_token) > 0 && strlen($oauth_token_secret) > 0) { $Twitter = new EpiTwitter($consumer_key, $consumer_secret); $Twitter->setToken($oauth_token, $oauth_token_secret); $status = $Twitter->post_statusesUpdate(array('status' => $message)); echo …

Member Avatar for almostbob
0
747
Member Avatar for admiri92

Are exceptions standardized in C++? I mean if the rules of exception handling might be changed in the future. i.e: int Funct1(int) throw(); // does it throw an exception?

Member Avatar for mike_2000_17
0
284
Member Avatar for havoc0921

I have an assignment for my cps class in which we have to create a program that will import a file from a server that has a bunch of numbers in it. The program is suppose to take those numbers, sort them, give the minimum and maximum value, average, median, …

Member Avatar for JamesCherrill
0
217
Member Avatar for spuriousgeek

I have been plagued by an issue for the past couple of days and I am yet to find a solution. I have an service installed at several customer sites. This service grabs data from a database, packages it up and then submits it to a web service hosted on …

Member Avatar for Maligui
0
292
Member Avatar for simran_4

Hello all, I am stuck with a nullpointerException at line 41 and 60.Can someone please help me out.any kind of help will be appreciated. Thanks import javax.swing.*; import javax.swing.event.*; import java.awt.Color; import java.awt.*; class calenders extends JFrame { int i=0; int j=0; int k=0; JFrame jf; FlowLayout fl; JPanel jp[]; …

Member Avatar for simran_4
0
557
Member Avatar for nathan.pavlovsky

Hello programmers! I am working on a Tic-Tac-Toe player vs. computer class, which is supposed to have a `run.()` method in order for the game to start. In a `gameWon()` member function, I am checking for a win, either by the player or by the computer. I check to see …

Member Avatar for Moschops
0
501
Member Avatar for cakka

Hello, I got this question from my quiz : > Consider the following code (assume that comments are replaced with real code that works as specified): public class TestExceptions { static void e() { // Might cause any of the following unchecked exceptions to be // thrown: // Ex1, Ex2, …

Member Avatar for JamesCherrill
0
303
Member Avatar for Momerath

Quite commonly I see people using one of the Parse routines then catching the exception thrown if the parse fails. This is, in general, a bad practice as throwing an exception is slower than using the corresponding TryParse method. This short snippet shows the routines that I used to measure …

Member Avatar for Mickey_1
0
556
Member Avatar for Louie_Rave

Hello. I uhh... I just want a sample code for the Exceptions: SecurityException and StackOverflowException. I'm still new to handling exceptions. Please, just a sample code that is about those two will do.

Member Avatar for |-|x
0
206
Member Avatar for robgeek

Hey everyone, I was attempting to get the lastmodified file from a folder, and to do so I used File.listFiles() method which is returning a null pointer exception even though the folder is not empty. I had this piece of code working about two days ago and I am not …

Member Avatar for sirlink99
0
8K
Member Avatar for |-|x

Hi All I have googled this exception extensively, and all the discussions I've found seem to be related to file uploading and exceeding the allowed file size limit. In my case however, I am not uploading anything, it is a simple postback. I have a gridview displaying the results of …

Member Avatar for BMXDad
0
1K
Member Avatar for klemme

Hi All, Im trying to learn how to use pdo, and am curious to know how i best can deal with allkind off errors. Lets say there is a typo, or im selecting an non existing row etc etc. In my connection, do I have do set anyting different here: …

Member Avatar for diafol
0
255
Member Avatar for lysv

I have a .Net web application where any uncaught exceptions get handled via the Application_Error event in Global.asax. Here, I email myself details of any uncaught exceptions that sneak through. My problem is that while I am getting the error messages just fine, I am not getting the line numbers …

Member Avatar for BMXDad
0
398
Member Avatar for STP_Captain_Slo

Hi I have a set of Checkboxes each with a Textbox next it to. I have the following code, which is meant to loop through each CheckBoxe and if checked if gets the text contained in the textbox, these are linked through the tag of the checkbox, i have used …

Member Avatar for rathideva
0
2K
Member Avatar for mahesh113

Hi All, Could you please clear my doubt why this second catch block is called when exception is thrown only once. #include <iostream> using namespace std; class E { public: const char* error; E(const char* arg): error(arg) {} }; class B { public: B() {}; ~B(){cout<<"~B() called"<<endl;} }; class D: …

Member Avatar for deceptikon
0
345
Member Avatar for mesbahuk

I have been working on a conversion project for last few days where I need to convert a Java library to C#. At one point I came to java's certain feature called [Exceptions Thrown by a Method](http://docs.oracle.com/javase/tutorial/essential/exceptions/declaring.html). Here is a little glimpse of it: public boolean isRequest() throws NullPointerException { …

Member Avatar for Ketsuekiame
0
301
Member Avatar for shubam
Member Avatar for pwolf

whats wrong with this code? It keeps giving me an "unreachable code detected " exception public static int search(string Registration) { // this method will search for registration, if found it will return the index value , else it will return max value + 1 for (int x = 0; …

Member Avatar for ndeniche
0
254

The End.