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.

0
votes
0answers
9 views

Exception error in exchangeElements procedure MASM

I am trying to implement selection sort in MASM and I am having issues with swapping the two values. I have tried to use a temp variable to swap the array elements but it kept giving me an error. I ...
0
votes
0answers
22 views

ArgumentException: Requested value 'X86' was not found

i try to import GoogleMobileAds sdk to unity. when i import PlayServicesResolver package, i am getting error on console like this 'ArgumentException: Requested value 'X86' was not found.' I cant ...
0
votes
1answer
10 views

What are the Implications of WCF TimeoutException vs CommunicationException on method execution?

I'm making a call to a WCF service that will initiate a batch of credit card charges. If an exception occurs, I want to know whether it occurred prior to the method executing and cards actually being ...
0
votes
1answer
19 views

Having trouble to get a file to read properly for my final lab of the semester and keep running into problems with reading the actual file

So we have a lab to do and it involves reading files and all that fun stuff. This is what the txt file looks like: Name0 22 1.2 Name1 22 2.71 Name2 19 3.51 Name3 18 3.91 Name4 20 1.6 Name5 19 1.03 ...
2
votes
1answer
21 views

Using a pointer arg to my function throws an exception

I am currently getting an "exception thrown" error on the line mov [ebx], eax I can't find a solution because all of them use this exact same code and it works for them. This is an exact copy ...
0
votes
1answer
30 views

nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection [duplicate]

I have an application that is not working on windows. But it is working fine on linux(Ubuntu) with absolutely the same code. MySQL is throwing an exception and I could not figure out how to solve it. ...
4
votes
4answers
64 views

When should we use throws keyword in Java? [duplicate]

throws keyword is used only for checked exception. It instructs the caller to use try catch block to except all the listed exceptions by throws keyword. Since we know what kind of checked exception ...
0
votes
0answers
17 views

How to handle “HTTP error 502” in python?

I,m trying to handle "HTTP ERROR 502" which is coming from reddit api service since its exceeding its Limit So I'm trying to reconnect it by following code snippet: import urllib import urllib....
2
votes
1answer
26 views

Is having two versions of the same method which only differ in their signature (method name and 'throws' attribute) considered bad design?

I would like to design an API where I have two versions of the same method, extractLastElement(): First version will not have a throws attribute: Object extractLastElementSafe(); Will be used when ...
-1
votes
0answers
11 views

org.springframework.security.core.userdetails.UsernameNotFoundException cannot be cast to org.springframework.security.core.userdetails.UserDetails

public class AppLoginFailureHandler implements AuthenticationFailureHandler { @Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, ...
-1
votes
0answers
21 views

Why does the keyword “throws” and error in the method declaration not change the output of this example? [duplicate]

In the following code: public class Program { static int foo(int a) { if(a == 0) { throw new ArithmeticException(); } else { return (a + 1); } ...
0
votes
1answer
28 views

Why is SEH considered “asynchronous”?

A few of the articles / answers I read on SEH (Structured Exception Handling) consider it to be 'asynchronous'. It is my understanding that the whole handling part of these exceptions occurs on the ...
0
votes
1answer
43 views

attached 'property was already registered by' my generic BaseAttachedProperty class causes design time exception

I'm developing an engineering application for work in WPF with VB.net and have a base class for attached properties which is based on Angel Six's code in C#. My base attached property is working fine ...
0
votes
1answer
21 views

Trouble catching exceptions occurring through 3rd party library deep in call stack

I am using an api to collect a lot of statistics of a website, but the website limits the rate at which I can pull data from the server by closing my connection once I reach this rate (usually raising ...
0
votes
0answers
21 views

How to fix “ImportError: Unable to load EGL library', 22, Le module spécifié est introuvable”

Good afternoon, I want to generate a rendered image from the 3D model in python using pyrender module. For this reason, I used this Code. # Render offscreen -- make sure to set the PyOpenGL platform ...
0
votes
0answers
20 views

If we throw an exception that's not caught again, do we get an empty response status?

Basically, I was sending a AJAX request with an object with some missing JSON data, and I was wondering why I didn't get a status code and got no response data. The JSON is valid, but there are ...
0
votes
2answers
51 views

Why does this method that throws an exception not have to be in a try catch block when invoked?

I invoke a method that throws exceptions, but I don't need to place this method inside a try catch block in static void main(String args[]), even though this tutorial says I should get an error. Why ...
-4
votes
1answer
26 views

I'm getting here NullPointerException. How to resolve this? [duplicate]

Why am I getting here NullPointerException in Junit test? I could make this code easier using a scanner, but because of the sonar I can't do it. public void readList() throws IOException { ...
0
votes
1answer
20 views

Exception thrown in NPOI while opening a file, but only in release mode

I just made a class that can translate an Excel file into a list of C# objects. I am currently working on Xamarin.Android. All worked fine in debug mode, the file was opening correctly. But when I ...
0
votes
0answers
5 views

Generating java classes from cXML dtd file

I have downloaded the cXML.dtd file from cxml org and trying to generate the java classes using the command below as given in java world xjc -dtd -d C:\Users\mansari7\Downloads\cxml\cXML_DTDs\cXML\1....
0
votes
0answers
13 views

Exception in TextFieldTableCell

I have editable TableView. One of column is only for integer value. this.hoursColumn.setCellValueFactory(new PropertyValueFactory<CourseFx, Integer>("liczbaGodzin")); this.hoursColumn....
0
votes
1answer
25 views

What is wrong with the revere function?

Django is throwing me a NoReverseMatch function but I cannot find the reason. I did check whether I use the reverse function correctly and it seems it does. I also think it is not the custom ...
5
votes
0answers
61 views

Stepping over a function with a throw statement inside in gdb doesn't take me to catch statement

I'm trying to step through a C++ program. It throws an exception in a lower layer, but I'm unable to have the gdb debugger take me to the catch statement. One workaround is to register catch-points ...
0
votes
1answer
26 views

Can't run my java .exe program. How do I troubleshoot this ? (“A Java exception has occured”) and JNI problem [Solved]

So I've wandered on a lot of the other posts but couldn't find an answer. My problem is that I created a Java app that I exported to .jar if I open it in .jar it works perfectly but I'd like to make ...
0
votes
0answers
8 views

Running out of memory while exporting excel file from C#

I have some manually user generated data in ASP.NET Core with Angular Interface which suppose to be export as an excel file, it is currently working for lesser amount of data, but when data increases ...
-1
votes
0answers
11 views

Java RMI saving object on server errors [on hold]

I got a problem when trying to save Person object on ServerOperation RMI server. Program gives me many errors: at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) at ...
0
votes
1answer
26 views

Produce proper status for every exception in @ExceptionHandler

I use @ControllerAdvice to catch exceptions in my Spring Boot controller. In @ExceptionHandler I can manually specify limited number of exception with their status codes. My question is how I can ...
-4
votes
1answer
48 views

Which is preferable try-catch or throw [on hold]

Here i start with exception handling in java. I have some code in which try catch exception is used and its working properly. If i turn this try catch into a throw statement then what steps should i ...
-1
votes
0answers
18 views

android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=20

I have a search view wherein I can enter words, the search view will search words from the SQLite database and display in another activity using a raw query. When I enter the first time it works fine ...
4
votes
1answer
31 views

How to raise an exception for a tensorflow out of memory error

I am running several tensorflow inferences using sess.run() in a loop and it happens that some inferences are too heavy for my GPU. I get errors like : 2019-05-23 15:37:49.582272: E tensorflow/core/...
3
votes
1answer
77 views

How to discover what exceptions can be thrown in Haskell?

While using wreq recently, I wrote code that compiled and worked for a while. Then, a HttpException was thrown. HttpException is not defined in wreq. I had to track it down to http-client. Then, a ...
1
vote
1answer
24 views

DataRow - OverflowException: Value was either too large or too small for an Int32

Issue I have come across some existing code that throws the error below, this is using .net framework 4.5.2 and v4.0.30319\System.Data.dll I have simplified the code example down to the part ...
0
votes
1answer
54 views

Handle exceptions in a rest controller in Spring Boot

I create REST web-service with Spring Boot. I would like to know what is a better way to handle exceptions in a controller. I have seen other questions and didn’t found an answer. My controller: @...
-1
votes
1answer
12 views

What is the advantage of following Inheritance

I frequently read code of the libraries I have come across the following code snippets. The code snippets are from the python schedule library I have searched internet but haven't found satisfactory ...
3
votes
1answer
30 views

[Easy|Power]Mock: make constructor.newInstance(…) throw an exception?

I want to make constructor.newInstance(...) throw an exception in a unit test. I'd like to check if the else-branch is reached in the following (dummy-)code: public <T extends IInterface> ...
0
votes
0answers
18 views

Tkinter throws weird incomplete exception

I'm creating an app that's supposed to pilot a robot I made and should be able to ask the robot to take a picture and get it back using SCP. def snap(self): #method of the netCamera class that asks ...
-2
votes
2answers
31 views

RestClientException while consuming a REST API in Java [on hold]

While trying to collect JSON from an API in a service class, RestClientException won't let run the app While I created a Abc class that would be able to consume the JSON from a REST API in the ...
0
votes
0answers
10 views

why java allows division by zero for floating points? [duplicate]

Java does not allows division by zero for integer values it throws arithmeticException on it and it allows the floating point values division by zero.why?
1
vote
2answers
45 views

How to write Junit test for this “FileNotFoundException”

How do I write a Junit test for FileNotFoundException, do I need to do something in the test so that my "numbers.txt" file is not seen? public void readList() { Scanner scanner = null; ...
3
votes
1answer
45 views

Blazor client-side Application level exception handling

How to globally handle application level exceptions for client-side Blazor apps?
0
votes
1answer
36 views

How can the JVM return an exception object at run time for a checked exception, if checked exceptions occur at compile time? [duplicate]

I understand that checked exceptions in Java are handled at compile time. If this is the case, how can the JVM return a checked exception object at run-time if we are still compiling the source code?
0
votes
1answer
25 views

com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.String to type com.studentcornerapp.studentcorner.Posts.Posts

I want to show all users posts using firebase recycler adapter.But I got Firebase Database Exception error and my app crashed. I don't know what am i doing wrong? I was initially doing everything ...
0
votes
1answer
14 views

How does Laravel validation return Exception as Json without try catch?

I'm bulding an exception log into my Laravel app to send mails or Telegram messages when an error identified as important is dispatched. Actually, I'm using a 'try catch' block on each of my ...
0
votes
1answer
33 views

any down side if i return from function in try block [on hold]

I am working on some python function and it worked well the way i implemented but i am looking for suggestion in terms of better coding practice and of course if my current implementation has issue. ...
0
votes
0answers
11 views

Null pointer exception when inserting data into Android SQLite Database

I'm just starting an Android Studio project and Ive created a small player database and I have been trying to add player details into the database. However each time the program crashes with a null ...
1
vote
1answer
53 views

How to check number of command line arguments + exception handling

How do I go about checking the number of command line arguments entered and then printing an error if its less than 3. static void Main(string[] args) { string file1 = args[0]; ...
1
vote
2answers
76 views

Simple exception handling

Hey so if I have this exception: try { List<string> inputFileLines = GetInputFileFormatted(mailFile); } catch (FileNotFoundException ex) { Console.WriteLine("File not found"); } How do ...
-3
votes
1answer
64 views

In what ways may Java throw an Exception without a `throw` statement?

I'm trying to find an exhaustive list of situations where the JVM will throw an Exception without there being a throw statement in Java code. Of course we are all familiar with NullPointerExceptions ...
0
votes
2answers
36 views

Handle Exception and Error Page in Servlet

By using the browser, when an error is throwed, i correctly being redirected to the custom error page specified in web.xml file But why i always see the default 400 error page with it's trace in the ...
1
vote
0answers
16 views

why is pylint complaining about missing Exception.message?

I usually declare a base exception for my modules which does nothing, from that one I derive custom errors that could have additional custom data: AFAIK this is the Right Way™ to use exeptions in ...

http://mssss.yulina-kosm.ru