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

How to Implementing Validation for RESTful Services?

I want to show validation errors when the validation fails. This is the code and I want to handle exceptions of when a parameter is null of missing ... I used this code but it's not working. } catch ...
0
votes
0answers
24 views

How can I determine what causes app to stop running

My app compiles without issue, other than a warning about cursor deprecation, and is deployed and runs correctly but stops after a few minutes and asks 'open app again?'. It reopens correctly. The ...
0
votes
0answers
7 views

Spring Reactor Exception

I get the following exception using Spring React. My method: public Mono<A> getA( @PathVariable(value ="id") Long id) { return <<some service call that returns Mono<A> &...
0
votes
1answer
18 views

Catching only *one* KeyboardInterruptException

I have a long-running task that may be interrupted because an exception is raised inside it, or because Control+C is pressed signaling a SIGINT, raising a KeyboardInterruptException. In both of ...
1
vote
1answer
15 views

try, except and logger Python

I have this method in my code but I want to pass the error to my log and to erase the print(e). def get_used(self, obj): try: return '<a href="%(url)s">%(name)s</a>' % {'url': ...
0
votes
0answers
3 views

Task scheduler console application shows just in time debugger on exception preventing program to run again

I have a console application that runs every 5 minutes with a Windows Server Task Schedule. The program doesnt run again if the program is still running after 5 minutes, so only one instance at a ...
0
votes
1answer
25 views

javax.crypto.AEADBadTagException - AES/GCM/NoPadding works, then doesn't

I am trying to decrypt some data from a DB and have run into some AEADBadTagExceptions, but not always. While searching for the error, I have taken the cipher initialization and put a loop around the ...
0
votes
0answers
13 views

How to use “problem detail” responses for unhandled exceptions?

As documented, ProblemDetails (based on the RFC 7807 specification) is the standard response for client error codes in ASP.NET Core 2.2. This works fine when I return things like NotFound() in my API ...
0
votes
0answers
6 views

Unable to connect to OIM server. [An error occurred while trying to notify server that a new login session has been created.]

I am trying to connect to the OIM server using oimclient.jar. When I try to login using below code. I'm getting error: An error occurred while trying to notify server that a new login session has ...
0
votes
0answers
16 views

Does uninstalling the android app will remove sqlite database, if sqlite database is locked.? [on hold]

My application database is locked and the database is not updating even the uninstall and install the application.In crash analytics i was found the exception like fallow... Caused by android....
0
votes
1answer
43 views

Ignoring exceptions vs throwing it explicitly

Is it alright to return an empty object in case of an exception or should we throw the exception so that caller may know what has gone wrong? public async Task<UserInfoModel> ...
0
votes
0answers
29 views

Reading Text File in Android Studio

I am new to Android programming and was trying to read data from a text file in Android Studio and use it to create a ListView with a custom search bar. Every time I try to read in the file, it gives ...
0
votes
1answer
44 views

Odd behavior after adding exceptions

I added some exception handling into some functions in my Project. Before adding the error handling the program was working normally. After adding the exceptions I now get garbage values in the ...
0
votes
0answers
11 views

Mapbox runtime crash: terminating with uncaught exception of type jni::PendingJavaException

I've seen similar issues raised on their GitHub page but they were closed after a new version fixed this issue. I've re raised that as a bug but have yet to get a reply. This crash happens pretty ...
0
votes
1answer
13 views

Asynchronous programming and interrupts exception handlers

I'm new to programming, just a question on how asynchronous programming actually works. We know that interrupts occur asynchronously as a result of signals from I/O devices that are external to the ...
0
votes
0answers
17 views

Spring Webflux ErrorHandling - @RestControllerAdvice with @ExceptionHandler or DefaultErrorAttributes?

In Spring Webflux what is the prefered way of Exception Handling? @RestControllerAdvice comes from Spring MVC whereas DefaultErrorAttributes comes from Spring Webflux. However, in Spring Webflux ...
1
vote
2answers
40 views

Is there any way within middleware running on ASP.NET Core 2.2 to detect if the request is for an ApiController?

I have an application with both MVC and 'new' ApiController endpoints in ASP.NET Core 2.2 co-existing together. Prior to adding the API endpoints, I have been using a global exception handler ...
1
vote
1answer
49 views

Whats wrong with these regex validation and exceptions?

This is an update to an older question. Im making a windows forms app to request contact information. I created a class to trim the input text and check if the textbox is empty. I also assigned ...
0
votes
1answer
35 views

Why arent the inputs following the patterns?

I'm making a Windows Forms app to request contact information. I created a class to trim the input text and check if the TextBox is empty. I also assigned patterns for the email and phonenumber. ...
3
votes
1answer
53 views

How is memory allocated in constructor released when the constructor throws an exception?

Below is my sample code. Base class has a pointer of A class with memory assigned from heap using new operator. I am explicitly throwing an exception. Since I am not invoking delete on *ptr the memory ...
1
vote
2answers
22 views

Send message with actionresult

I need to return the server error from azure functions. Now I implement the same using InternalServerErrorResult(). It only sends the error code and no response/message can be sent with this function....
1
vote
1answer
46 views

How to handle exception in Python?

I'm working on getting details for list of movies from IMDB using Imdbpy library. However I'm unable to handle the generated exception. Can anyone please let me know where am I going wrong? Here's ...
1
vote
0answers
32 views

Continue after exception or Error in Rest Api call using OAuth2RestTemplate

i am making a rest call using Spring Oauth2RestTemplate. I am trying to catch any exception while trying to make a restAPI call and continue the flow of Exception. Two ways i tried: Way I(Using try ...
0
votes
1answer
13 views

How to get a useful exception message from decimal in python 3?

With Python 2, creating a Decimal with an invalid string produces a useful error message: >>> import decimal >>> decimal.Decimal('spam') Traceback (most recent call last): File "&...
0
votes
2answers
14 views

why am receiving a mapping exception with the root cause as SAXParseException; lineNumber: 19; columnNumber: 45

Buyer.hbm.xml is the buyer mapping file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate....
0
votes
1answer
59 views

Java NameLengthNotValidException always gets thrown in domainclass

IMPORTANT: Probably a rookie question, but I'm clueless on how to solve it. I have a UI class which I use to input a name and gender (geslacht) using a scanner (see code below) private static void ...
0
votes
0answers
15 views

handling SEH exception of specific type (access violation only)

In order to handle access violation exception, project should be configured with SEH Exceptions (/EHa). I'm looking for handling access violation exceptions only. According to this Microsoft ...
0
votes
0answers
12 views

aarch64 Exception Level Switch from EL1 to EL0

I am working on a simple kernel and test it on Qemu which supports RasPi3. During the boot level, Ras Pi goes to EL3 level, and I set spsr_el3 to 1 and elr_el3 to kernel_main and then use eret to ...
1
vote
4answers
33 views

How to know if exception is built-in or user-defined in Python

I have my own exception classes inheriting from Exception class. I could check if type is in {..my exceptions list..}, but that seems problematic in my case. Is there any other way of checking if the ...
0
votes
0answers
17 views

IText exception while creating document

my code: public byte[] render(@NotBlank String html) { try(ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { iTextRenderer.setDocumentFromString(html); ...
-5
votes
0answers
26 views

Why am i getting exception like this? [on hold]

I was getting normal exceptions but suddenly it turned out all exceptions give pages like this: When exception occurs, instead of displaying page with exception message and stack trace, i only get ...
0
votes
2answers
17 views

Catching exception errors when logging in via NodeJS + MySQL

Recently I've been trying to learn NodeJS to set up a log in process, so I decided to write all the errors and make exceptions for them. My question is how can I make sure each if is responsible for ...
0
votes
2answers
29 views

How can I get data from a response after `RestTemplate` throws a `RestClientException` because it couldn't parse it

Using restTemplate.exchange(uri, method, entity, responseType) to make a REST call fails with a RestClientException when the response is of the wrong responseType. E.g., org.springframework.web....
0
votes
0answers
22 views

The operation 'setBrokerPubQ()' is not valid for type 'com.ibm.mq.jms.MQQueueConnectionFactory'

Good day, I have a web application that deploy on a WAS server. After deploy, I am able to browse the application successfully and everything seems OK. However, when I check back the ffdc log, I ...
3
votes
2answers
35 views

Handle exceptions in VB.NET SSIS script with WebClient (FTP download)

In SSIS I am using a VB.NET script task to download a file from an FTP folder. The script is the following Imports System Imports System.Data Imports Microsoft.SqlServer.Dts.Runtime Imports System....
0
votes
1answer
33 views

Custom exception not caught in calling method [duplicate]

I have a custom exception that I throw in a class that is not caught in another class. I don't know what's wrong here : Class MailService.java @Async public void sendMail(String to, String subject)...
0
votes
1answer
40 views

IntelliJ IDEA: Exception removal will break source code. Proceed anyway?

I have a method that throws a deprecated exception, which I've removed all cases where this exception is thrown. I tried to use IntelliJ IDEA's "Remove from throws list" refactor action to remove it,...
0
votes
2answers
36 views

django: Displaying database errors when debug = False

I am using Django Rest Framework to perform get() post() on existing database. In the models, I haven't defined any primary or foreign key relations as these constraints are handled at database level. ...
0
votes
0answers
45 views

exception message in a constructor

So I have a method that throws an IllegalStateException @Override public Value getJSONValue(String query) throws IllegalStateException { Value result = null; JSONIter iter = obj.iterator(); ...
0
votes
2answers
22 views

How to see if during int casting its not an int

I have this Matrix=[['1', '2', '3'], ['4', 'a', 'n']] Im doing this: Matrix=[arr.split() for arr in Matrix] Matrix=[list(map(int, arr)) for arr in Matrix] as you can see I have 'a' and 'n' there, I ...
1
vote
1answer
21 views

Catching uncaught exception in async function (Javascript) [duplicate]

Currently I have code such as: window.onerror = function() { // Send some debug info about the defective error handling, // so that it may be fixed }; To handle otherwise uncaught exceptions....
0
votes
1answer
25 views

How to throw an exception in antlr4 visitor methods?

I am using the visitor method to evaluate the code as it's parsed. For function calls, I want to handle the return statements by having the visitor method for the return statement rule throw a custom ...
0
votes
3answers
38 views

Exception on static variables

class A { static int a = 1 / 0; } In this code when we load the class, it will throw an exception because of arithmetic exception. How can I catch that exception?
1
vote
4answers
62 views

Catch exception from toString method in Java

Recently I saw following piece of code on GitHub: private static String safeToString(Object obj) { if (obj == null) return null; try { return obj.toString(); } catch (Throwable t) ...
0
votes
0answers
20 views

Is the approach to dealing with errors and exceptions correct?

I wanted to ask a question regarding the approach to work with exceptions and errors. I have my own development of the MVC application, in which it is necessary to work with errors. As it seems to me, ...
0
votes
0answers
11 views

Python unit test mock: raising an exception from imported class

I want transaction.AutoSave.save() (Imported) from autosave script to throw an OperationalError exception when I run the unit test but It doesn't throw an exception, it just passes the test even ...
0
votes
0answers
16 views

Error while evaluating expression: com.sun.jdi.InternalException: Unexpected JDWP Error 23

I am implementing a card game in which i am swapping two cards images, i am getting following exception while loading and swapping images. Due to this exception, my images are not getting display on ...
1
vote
2answers
17 views

Catch exact item that throws Exception in a for-each loop

I need access to the File variable f inside my catch clause. How can I achieve this? try { for(File f:filesInDir) { new Scanner(new FileInputStream(f)); } catch(FileNotFoundException e)...
1
vote
1answer
23 views

Web scraping - handling non fatal errors

Using web scrapers (bs4, selenium) and wondering if there is a better way to handle exceptions that are not fatal (i.e. continue running after exception). There are a lot of try excepts in my code ...
0
votes
1answer
48 views

When can std::vector::pop_back throw an exception [duplicate]

I am surprised to see that the standard C++ std::vector::pop_back() mutator is not noexcept, and so is permitted to throw exceptions. Surprised, because it is a destruction type operation, which ...

http://mssss.yulina-kosm.ru