179 Topics
|
|
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 … |
|
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: … |
|
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? |
|
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 … |
|
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 … |
|
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 … |
|
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 = … |
|
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) … |
|
Following exceptions are `Checked Exception` or `Unchecked Exception` ArrayStoreException IllegalArgumentException |
|
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 |
|
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 … |
|
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 … |
|
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 … |
|
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? |
|
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, … |
|
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 … |
|
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[]; … |
|
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 … |
|
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, … |
|
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 … |
|
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. |
|
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 … |
|
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 … |
|
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: … |
|
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 … |
|
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 … |
|
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: … |
|
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 { … |
|
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; … |
The End.