Questions tagged [exception]

An exception is an unusual condition that requires deviation from the program's normal flow. Normally, an exception should not result in total failure, but instead be attended by an exception handler. Exception handling is a built-in construct in many programming languages. Usually, exceptions are handled by unwinding the stack, thus rolling back to a defined state outside the exception's scope, and then invoking a handler block or routine.

exception
Filter by
Sorted by
Tagged with
0 votes
3 answers
1k views

java.lang.UnsupportedOperationException but no Arrays.asList()

Getting the below exception which usually comes when we assign a list from a array using Arrays.asList() but i could not see any usage of Arrays in the code where it is being thrown. Moreover the list ...
Sachin's user avatar
  • 39
0 votes
2 answers
90 views

Android Exception: UnknownFormatConversionException

Hi I am setting some text inside a RobotoText that is positioned inside of a ViewHolder I am calling it like this: viewHolder.txtSimilarAds.setText((((Property) ads.get(position))....
user3182266's user avatar
  • 1,310
-1 votes
2 answers
3k views

C# OpenFileDialog - exception when no files are chosen

I am trying to work out on this error, when no files are chosen the program obviously goes to do next step although it shouldn't. I have tried: if (fileToCheck != null) but it didn't work. Any other ...
Ken'ichi Matsuyama's user avatar
4 votes
1 answer
5k views

How can I create a custom exception in my Rails application?

I am trying to create custom exceptions in rails, but I 've problem with my designed solution. Here what I've done so far: -Create in the app/ folder a folder named errors/ with a file exceptions.rb ...
ciaoben's user avatar
  • 3,258
1 vote
0 answers
392 views

oleDB connection: getting exception querying MDX from C#

Please: I receive following exception when trying to run my code: Object reference not set to an instance of an object... using (OleDbConnection conn = new OleDbConnection(@"Provider=MSOLAP.4; Data ...
Peter's user avatar
  • 133
3 votes
1 answer
153 views

Why can't SyntaxError be caught by user code? [duplicate]

I want to catch every program error so that I can display those errors in my GUI program, but I find I'm not able to catch certain kinds of error like SyntaxError and IndentError. For example: ...
Jimm Chen's user avatar
  • 3,603
-1 votes
1 answer
7k views

raise child_exception , OSError: [Errno 2] No such file or directory

import sys,os import subprocess import pdb pdb.set_trace() findCMD = 'find . -name "pcapdump0"' print os.getcwd() print findCMD out = subprocess.Popen(findCMD,stdout=subprocess.PIPE) (stdout, stderr) ...
Shivani H Khattar's user avatar
2 votes
3 answers
4k views

Throwing exceptions from Spring REST webservice as JSON/XML

I have a REST web service controller that looks like this: @RequestMapping(value = URIConstants.URL_DOCUMENT_SEARCH, method = RequestMethod.POST, produces = { MediaType.APPLICATION_XML_VALUE, ...
Albert Pinto's user avatar
2 votes
2 answers
886 views

NoSuchMethodError in JNI to Java Exception

I am getting this error: java.lang.NoSuchMethodError: no non-static method "Ljava/lang/AssertionError;.(Ljava/lang/String;)V" jclass clazz = env->FindClass( "java/lang/AssertionError" ); env->...
ssk's user avatar
  • 9,175
0 votes
1 answer
189 views

Emulator in Android Studio won't load

Rendering problems. The following classes could not be instantiated: - android.support.v7.internal.widget.ActionBarOverlayLayout . Exception Details: java.lang.ClassNotFoundException: ...
dedpule's user avatar
1 vote
1 answer
722 views

Rescuing third party REST API exception in Rails

I am connecting to Docusign via their REST API. Currently, I'm rescuing all exceptions which I understand is not a good idea. I would like to rescue certain exceptions that are thrown by the API. When ...
Questifer's user avatar
  • 1,113
1 vote
0 answers
2k views

leaflet Uncaught TypeError: t.onAdd is not a function

i have this exception when clicking the checkbox options in the leaflet layer control, the objetive of this code is to load all the makers based on a type, these markers goes into the subsarrays and ...
Hex's user avatar
  • 434
0 votes
2 answers
1k views

Rails External Service Exception Handling

I am connecting my application to a third party API to pull and push data. One thing I'd like to do is implement some exception handling so my users will receive a related error message if something ...
Questifer's user avatar
  • 1,113
3 votes
3 answers
115 views

Have exception hit two except blocks in python

Here is an example of something I want to do in code: class MyClass(object): @classmethod def test_func(cls, x): try: return cls.cache[x] except AttributeError: ...
sedavidw's user avatar
  • 11.4k
7 votes
2 answers
8k views

Spring Data Rest exception handling - Return generic error response

I want to know how can I handle internal server error type exceptions in Spring Data Rest such as JPA exceptions etc. due to a malformed request or a database crash. I did some research found that the ...
Vijay Muvva's user avatar
  • 1,073
1 vote
1 answer
3k views

Build Error in Gradle Project Creation

I'm using Netbeans 8 with the newest Gradle plugin and any time I try to create a project (either root or standalone) I get a build error with the following exception. The build.gradle and common....
Sarah Szabo's user avatar
  • 10.5k
1 vote
1 answer
2k views

Specifying throws IOException

Can anyone help me solve my problem. I am a beginner in Java programming. Previously when I did not declare throws IOException it gave me an error: Exception in thread "main" java.lang....
user avatar
0 votes
2 answers
421 views

Handle error in python [closed]

I'm new to Python and I want to know the best way to handle the following error: downloaded = raw_input("Introduce the file name: ").strip() f, metadata = client.get_file_and_metadata('/'+downloaded) ...
AFS's user avatar
  • 1,443
2 votes
1 answer
6k views

java.io.FilePermission read access denied when launching applet with java 8

I have an applet class that's trying to read a file in the client's system. but when accessing this file, i get java.io.filePrmission error java.security.AccessControlException: access denied ("...
user4900143's user avatar
0 votes
0 answers
38 views

Trouble with data reader

Afternoon, I am writing a database management program to make things easier at work. I'm having trouble with the datareader if the table returns no results. I have searched all over the web for a ...
Matthew Rossiter's user avatar
0 votes
4 answers
1k views

How get value from mule payload

How I get value from mule payload. I am unable to get from mule payload. ExceptionMessage{payload=ActiveMQTextMessage {commandId = 14, responseRequired = false, messageId = ID:localhost....
chetan singhal's user avatar
0 votes
1 answer
1k views

Missing Method Exception in Grails when rendering as JSON

I am new to Grails completely and trying to implement it with a todo app I am creating. I am having issues with my first controller function add(). Here is my code: package server import grails....
Ajv2324's user avatar
  • 522
7 votes
3 answers
14k views

Don't know where exception was thrown using google-test

We are using Google Test as our C++ unit testing framework. But I ran into a painful situation and don't know how to deal with. Basically, when there is an uncaught exception in the code, I got the ...
Yuchen's user avatar
  • 32.1k
3 votes
2 answers
3k views

Throwing exceptions from JBPM WorkItemHandlers?

I'm a little confused about the subject of throwing exceptions from JBPM work item handlers and handling the exception elsewhere in the business process. We're using JBPM 6.0.3 to run in Jboss EAP 6.1....
Kenster's user avatar
  • 24.4k
3 votes
1 answer
6k views

wildfly not loading class from web.xml

Am unable to run the war, as i configured all the modules in wildfly, and this war is running good in jboss 6 with same web.xml config, and when i deploy in wildfly after all setup for migration then ...
Raj Kumar Samala's user avatar
0 votes
2 answers
186 views

Exception handling in Erlang to Continue execution

What I am trying to do is mochijson2:decode(Ccode) generates any exception or error, program execution should not stop and case branch {error, Reason} should get executed. But when I am trying to ...
Gopal S Rathore's user avatar
2 votes
2 answers
2k views

Not able to catch org.hibernate.StaleObjectStateException

Can we not catch the StaleObjectStateException? I have catch block with StaleObjectStateException , so when method is throwing this error it is coming to this catch block but still throwing the same ...
Reddy's user avatar
  • 41
19 votes
3 answers
3k views

How to suppress displaying the parent exception (the cause) for subsequent exceptions

I'm aware of raise ... from None and have read How can I more easily suppress previous exceptions when I raise my own exception in response?. However, how can I achieve that same effect (of ...
vashekcz's user avatar
  • 571
13 votes
1 answer
12k views

To combine two catch clasuses in the same [duplicate]

I have the following code: try { //do some } catch (NumberFormatException e) { return DynamicFilterErrorCode.INVALID_VALUE; } catch (ClassCastException e) { return DynamicFilterErrorCode....
St.Antario's user avatar
  • 26.8k
-1 votes
1 answer
2k views

ArrayIndexOutOfBoundsException: 1 in web server

I have made a simple RESTful web service using tomcat web container and jersey library. I have overridden only post method, rest all default settings are used. While sending POST query from curl ...
anant sophia's user avatar
0 votes
1 answer
52 views

Dictionary in Settings throws an exception?

I want to save a dictionary in the default UserSettings class of my project. I've tried the following in the code of the Settings file but it fails: <Setting Name="MediaKeys" Type="System....
Will's user avatar
  • 3,473
0 votes
4 answers
858 views

i am getting an error of array index out of bounds for the code below...why?

why am i getting an array index out of bounds for this code? i am getting an error exception in thread MainJava.Lang.ArrayIndexOutOfBoundsException //java calculator public class Calculator { public ...
sally's user avatar
  • 11
7 votes
3 answers
1k views

Can exit() from a library be replaced with throwing an exception? [duplicate]

I'm working with a C/Fortran library from C++ and the library calls exit(). I would like it to throw an exception so that the destructors in my C++ program will be called. I have been able to create ...
Dave Johansen's user avatar
0 votes
1 answer
1k views

Throw exception with inner exception in WCF

I am trying to send an exception over the WCF wire but can't figure out what I have done wrong. I am following the guidance of Oleg Sych and MSDN but to no avail. What I get back is The requested ...
LosManos's user avatar
  • 7,481
0 votes
0 answers
995 views

Why doesn't Application_Error in my global.asax catch the “500:Internal server error”?

When a response is returned with StatusCode (500), the Application_Error sub in my Global.asax is not being fired.
Ala's user avatar
  • 1,503
-3 votes
1 answer
998 views

c++ vector push_back access violation

I'm struggling with a random exception when using std::vector. Here are the main elements : struct Stroke { std::vector<vec2> points; Pixel color; std::vector<unsigned int>...
Xelareip's user avatar
5 votes
3 answers
4k views

Passing exceptions between two C# programs using JSON

I have a Web API which makes HTTP Requests to a windows service that executes certain tasks/commands. If my 'service' throws an exception I then want to pass that exception back up the pipe to the ...
Zapnologica's user avatar
  • 22.4k
3 votes
2 answers
1k views

In Xcode, is there a way to bypass the "All Exceptions" breakpoints just for one or more lines?

I'm being driven slowly insane by this line of code: NSDictionary* rectangle3FontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"TrajanPro3-Regular" size: 18], ...
Hari Honor's user avatar
  • 8,816
2 votes
6 answers
2k views

Difference between catch vs catch and rethrow exception in java?

We can throw exception by try-catch or throw Scenario 1: public void testMethod() throws MyException { throw new MyException(); } Scenario 2: public void testMethod() throws MyException { ...
Sasikumar Murugesan's user avatar
0 votes
1 answer
1k views

Throwing SAXException

Learning xml parsing with Java, and am working in a test program to try things out as I go. All of the test System.out.println()'s were what I expected in the console except childElement was returning ...
Mercutio's user avatar
  • 1,227
0 votes
2 answers
40 views

How to get the exception object thrown in the default

I know that we can get the exception object if we use the 'as' syntax:- try: 1/0 except ZeroDivisionError as e: print "can not divide zero" print(str(e)) I'd like to capture everything .....
lionel319's user avatar
  • 1,240
2 votes
3 answers
4k views

Why does Python throw a KeyError when accessing an unset property?

What are the rationale and implications for throwing KeyError instead of returning None when accessing an unset property on a Python dictionary? I know that language design involves trade-offs, some ...
Peter Manning's user avatar
0 votes
2 answers
96 views

Error in SerialPort Closes Thread but don't change it's Status and don't raise an Exception

I am reading a SerialPort in a separate thread using the code below. I open the Serial Port and try to read a line. Since there is nothing connected in the Serial Port there is an error. I was ...
Michel Feinstein's user avatar
4 votes
3 answers
677 views

InvalidCastException from List<T> to IEnumerable<T> only in 3.5

If i call that var list = new List<Class1>(); Test((IEnumerable<Interface1>)list); with public interface Interface1 { } public static void Test(IEnumerable<Interface1> test) { }...
DarkPixel's user avatar
  • 246
2 votes
3 answers
305 views

Best way to handle a try/catch exception in a do ... while() evaluation?

In this scenario: Cursor cursor = dbHandler.fetchEvents(); boolean someBool = true; do { someStuff(); variables = things; otherStuff(); } while (someBool && cursor.moveToNext()); ...
AWT's user avatar
  • 3,667
2 votes
1 answer
429 views

Unable to get flow variable inside exception-strategy

Unable to get flow variable inside exception. In below code I am trying to use centirofilename inside default-exception-strategy. It gives Exception <set-variable value="#[xpath('//soap/filename/...
chetan singhal's user avatar
8 votes
4 answers
3k views

NoClassDefFoundError after renaming a package

I am writing a simple application using Netbeans; on creating a new Java project I renamed the automatically created package from oldpackage to newpackage using Netbeans' rename function (ie using ...
NRKirby's user avatar
  • 1,594
1 vote
1 answer
2k views

Is there a way to stop Stack traces from being output with an Exception error?

I want to stop Stack Traces from appearing in my fatal errors in PHP. My PHP code: throw new ErrorException('Failed here!', 10); Results in: Fatal error: Uncaught exception 'ErrorException' with ...
dazziola's user avatar
  • 193
0 votes
2 answers
4k views

Cannot use '@try' with Objective-C exceptions disabled

Im trying to make a category in Obj-C and use @try-catch because there is no other way to check if an identifier in a UIStoryboard exists. - (UIViewController *)viewControllerWithID:(NSString *)key { ...
Arbitur's user avatar
  • 38.9k
1 vote
1 answer
2k views

How do I successfully use the Thread.sleep() method in Graphics?

This is my code so far: // Imported Classes public class Timer extends Applet { public void paint (Graphics page) throws InterruptedException { Thread.sleep(1000); } } I just ...
xInMourning's user avatar

1
508 509
510
511 512
1080