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.

Filter by
Sorted by
Tagged with
0 votes
2 answers
55 views

Java - Exception without interrupting program

For example i have list, class and methods: List<Client> myClient = new ArrayList<>(); public class ClientNotFoundException extends RuntimeException { public ClientNotFoundException()...
Qmails's user avatar
  • 75
0 votes
0 answers
6 views

Error in Spring boot Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback

In browser getting below error rather than JSON Error message but it is working in Postman.I need print the JSON Error message in Browser . Anyone can help here how to display the error message in ...
Rose's user avatar
  • 111
-3 votes
0 answers
31 views

Exception Handling Even Though I've Put JavaFX [closed]

package yin; import javafx.application.Platform; import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene....
james51's user avatar
  • 13
0 votes
0 answers
21 views

how RISCV architecture suggest to fill mtval register in instruction address fault?

If mtval is written with a nonzero value when a breakpoint, address-misaligned, access-fault, or page-fault exception occurs on an instruction fetch, load, or store, then mtval will contain the ...
Ömer GÜZEL's user avatar
0 votes
3 answers
43 views

Should I create exceptions for every error in Java?

i'm new to Java and I've been studying exceptions, my question is when should I create a custom exception or not. For example I'm creating a simple app to deposit and withdraw from a Account, right ...
PauloRamos's user avatar
0 votes
0 answers
10 views

WCF service throws exception when streaming files over 100mb or so

We have a streaming client/server system which runs fine in many sites, and has done so for years One site is having a problem when streaming files over 100mb or so Other sites routinely stream files ...
Bill's user avatar
  • 79
0 votes
0 answers
17 views

CS50 Fuel Gauge what causes inputs like '1.5/3' results in reprompt?

I had passed all the tests but I'm just curious about how do inputs like '1.5/3' or '2.5/5' gets reprompt? Below is the code: def main(): percentage = -1 while percentage == -1: ...
Pius0405's user avatar
0 votes
0 answers
15 views

How to intercept and handle Exceptions thrown by Quarkus

I have an endpoint to upload files, which is never reached when the payload violates the limit in the quarkus.http.limits.max-body-size property. I'm receiving an HTTP 413 Exception, which is fine, ...
Miguel Angel Romero Olaya's user avatar
0 votes
1 answer
21 views

Exception Handling in OCaml

Say we have these two functions: let divide_and_match x y = match y with | 0 -> raise (Failure "Division by zero") | _ -> x / y let divide_ten x y = match x with | 10 -> ...
penguin365's user avatar
1 vote
0 answers
41 views

FileNotFoundException after migrating from .Net framework to NET

During the migration of our software from .Net framework 4.8 to NET 6, I encountered the following error at runtime when running the project called "Viewer": Exception: System....
Yamithrain's user avatar
0 votes
1 answer
31 views

Problem with "java.lang.reflect.InvocationTargetException"

I am very new to this and I have a problem with this message that I get every time I try to run a program. I've tried a thousand things and I don't know what else to do. If anyone could help me I ...
Alejandro Ardila's user avatar
-1 votes
1 answer
19 views

Remote Handle Exception in Jmeter

I am working on the app which was tested using LoadRunner Ajax TruClient Protocol in the past.We are migrating the scripts to JMeter where we are receiving the error on one of the call ending with ...
Gaurav Bhardwaj's user avatar
1 vote
1 answer
57 views

Difficulty Identifying Custom Exception Type in TypeScript throw Statement

I've encountered an issue while working with a custom HttpException class in TypeScript. Here's the structure of the class: class HttpException extends Error { public status: number | undefined; ...
Roni Jack Vituli's user avatar
0 votes
0 answers
21 views

VB .net: SetDatabaseProviderFactory is not a member of DatabaseFactory

I am trying tp upgrade one of our old MVC application and that has exception handler library in VB. net built using Microsoft.Practices.EnterpriseLibrary.Data. Now I am trying to compile the exception ...
Man_Testing's user avatar
3 votes
1 answer
71 views

Not able to customitze AccessDeniedException

I get the exception org.springframework.security.access.AccessDeniedException: Access Denied but I would like to have my own custom exception. This is what I have tried: package com.example.dq....
xRay's user avatar
  • 639
0 votes
1 answer
44 views

Exception has occurred: FileNotFoundError [Errno 2] No such file or directory: 'pi_digits.txt'

I'm trying to open a file and print out the contents, but when I run the code, I get the error Exception has occurred: FileNotFoundError [Errno 2] No such file or directory: 'pi_digits.txt' Here is ...
Wizard.py's user avatar
1 vote
0 answers
47 views

Aspect AOP not intercepting all methods within pointcut

I have created an aspect for the purpose of error logging and reporting within a microservices system but it is not intercepting all the methods that throw an exception within the pointcut. import ...
nova_rem's user avatar
0 votes
0 answers
18 views

catch exception of serilog sink

Im trying to catch an exception in an asp.net core app which seems to be not directly on application level. Im using serilog with Serilog.AspNetCore and an mqtt-sink: builder.Host.UseSerilog((ctx, ...
pyrogen's user avatar
  • 219
0 votes
1 answer
52 views

C# Export Logs to 2 txt files

So I have a button made from my xaml file (view), called Export. When the user clicks on it, the logs created during the run of the app get exported to Logs.txt. If there are Warnings, Errors or ...
PinkGoat_'s user avatar
0 votes
0 answers
23 views

Nested use of C++ std::async to create threads, which can delay the exception when there is insufficient resources

I am trying to simulate the exception behavior when the number of threads exceeds the linux limit. I found that when I continuously use std::async(std::launch::async, &func) in a thread, without ...
Consen's user avatar
  • 1
0 votes
0 answers
13 views

Test case fails for custom exception flutter mockito [duplicate]

I write a calculator service test case, by mocking calculator object using mockito This is my test cases import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import ...
Balaji's user avatar
  • 1,854
0 votes
0 answers
10 views

Requests exception with API failure message

I'm making a request to an API using python requests. The best practice to raise an exception is with the raise_from_status method on the response object, see here. Assuming the API returns some ...
Little Bobby Tables's user avatar
0 votes
0 answers
40 views

interrupt() on Thread does not necessarily throw InterruptedExeption when join() is called

I have a main class which starts another thread like: public class Main { public static void main(String[] args) { var worker = new Worker(Thread.currentThread()); worker.start(); ...
Stefan's user avatar
  • 1
0 votes
1 answer
51 views

Preferred method for raising Python Exception from many codepaths?

I am writing code in Python, using PyTest for testing. Suppose I am performing some task that may fail in many possible ways. I have a function that performs this task, and counts the number of times ...
pluto_projector's user avatar
0 votes
0 answers
16 views

Avoiding Stack Overflow Errors in C# Web Applications with EDMX: Best Practices and Strategies

I'm working on a C# web application that utilizes an Entity Data Model (EDMX) for data access. Recently, I've been encountering stack overflow errors in certain parts of my application. I suspect that ...
tech's user avatar
  • 1
1 vote
0 answers
25 views

Providing More information about DioException or DioErrors.?

I'm using Dio to make API calls in my Flutter app and I've implemented a custom error handler to deal with different types of errors. I'm getting the generic error message 'Something went wrong. ...
Dhruvil's user avatar
  • 162
0 votes
0 answers
10 views

FOSElastica "Cannot find corresponding Doctrine objects for all Elastica results" - delete the missing one

I have a big cms project done in symfony+doctrine+foselastica. Sometimes, if a db persistence is missing I get an exception like "Cannot find corresponding Doctrine objects for all Elastica ...
Zak's user avatar
  • 591
-2 votes
0 answers
25 views

how to write exception for spring boot 3 security for whitelistURL and authorized url in same jwtauthenticationfilter [closed]

try { String servletPath = request.getServletPath(); if (Arrays.asList(WHITE_LIST_URL).contains(servletPath)) { // Allow whitelisted URLs without token validation ...
Developer's user avatar
0 votes
0 answers
17 views

WindowManager: BadTokenException with Accessibility service context

class MyServiceClass : AccessibilityService() { private val overlayParams = WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT, ...
ghita's user avatar
  • 2,756
-1 votes
2 answers
59 views

Suppressed Exception

In the book OCP Java SE 8 Programmer II by Kathy Sierra, on page 203 it states that: "9. D is correct" wherein is D. RuntimeException c with no suppressed exception but when I try to run ...
George's user avatar
  • 497
0 votes
1 answer
65 views

sqlalchemy.exc.IntegrityError: How to pass exception details?

For a web scraping task I am building up a database using SQLA 2.0: A weppage is scraped, the results are temporarily kept according to `project_min_example ` (struture in code block below). After a ...
rumpel360's user avatar
0 votes
1 answer
57 views

SizeLimitExceededException vs FileSizeLimitExceededException - Different exception for different file sizes

We are getting different exceptions when we upload files of different sizes. The max file size allowed is 1 MB. spring.servlet.multipart.max-file-size=1MB When we try to upload a file of 5.95 MB we ...
Arun Sudhakaran's user avatar
0 votes
0 answers
25 views

Pandas - convert the list of string to list of integer [duplicate]

I have a dataframe like this: | customerID| clickHistory | | -------- | -------------- | | A | [] | | B | ['85','14','23'] | | C | [] | and I want this table to be: | ...
DS Park's user avatar
  • 159
0 votes
0 answers
207 views

SSLCertificateVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997) [duplicate]

I am trying to make a Discord bot using the ChatGPT API: import discord import random import requests intents = discord.Intents.default() intents.messages = True client = discord.Client(intents=...
William Zeng's user avatar
-1 votes
1 answer
58 views

How to catch NotFoundException with ControllerAdvice in Spring Boot?

I'm working at a Spring Boot project and I want to handle the exceptions for the REST API using @ControllerAdvice. And I want to handle the case when the endpoint is not spelled correctly. For example ...
elvis's user avatar
  • 822
0 votes
0 answers
19 views

catching a Timed Out response as an exception

30% of the time, my response via a AJAX call is returning 504 Gateway Timeout. But I can’t seem to ‘catch’ it as an exception. try { $response = $client->chat()->create([ 'model' =&...
anjanesh's user avatar
  • 3,927
1 vote
0 answers
29 views

Override the __str__ of ExceptionGroup to include the exceptions' message

I was trying to use the new API of ExceptionGroup (reference https://docs.python.org/3/library/exceptions.html#exception-groups) And it was just great, so for example if I do: raise ExceptionGroup('...
Dorki's user avatar
  • 1,083
0 votes
1 answer
39 views

@RestControllerAdvice not able to catch basic AuthenticationException through custom authentication entrypoint [duplicate]

My requirement to catch basic auth exception in controller advice For that used the below code for authentication entrypoint, @Component("delegatedAuthenticationEntryPoint") public class ...
Shreekanta Roychowdhury's user avatar
7 votes
0 answers
111 views

Catching a converted temporary by reference, on all three major implementations

I'm confused by all three mainstream compilers/runtimes' handling of this C++ code (Godbolt): int main() { int i = 42; try { throw &i; } catch (void*&) { puts("...
Quuxplusone's user avatar
  • 24.3k
0 votes
1 answer
128 views

Routine to perform actions in Tasks, showing a loading screen, without freezing the main form

I'm looking to build a routine that is responsible for executing any action via procedure (Tproc) using Tasks, while displaying a loading screen, without freezing the system's main form. An extra ...
Rafael's user avatar
  • 3
0 votes
0 answers
25 views

Node.js mssql error handling with wrong input

Somehow try catch or .catch(error) doesn't show the exception that occurs when you pass not_a_date param here. To find out where was the problem I had to remove try/catch and see server crash with ...
Serge Makarov's user avatar
0 votes
1 answer
70 views

How to create one-to-one multithreading relationship and handling exception in C#

It's the first time that I work on multithreading application (in general, not only with C#), and for this reason I know only simple notions about it. I've realized basically implementation with ...
Gabriele Troviso's user avatar
0 votes
0 answers
31 views

Invalid Argument exception in Selenium

I created a method for photoUpload public void uploadPhoto() { ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", wePhotoInput); ...
Katarina's user avatar
0 votes
0 answers
32 views

How can I configure my global error handler?

I have my custom error class: using Newtonsoft.Json; namespace Services.Errors.Exceptions; public class HttpResponseException : Exception { public int StatusCode { get; private set; } public ...
Какосян Владимир's user avatar
2 votes
2 answers
51 views

How to instantiate std::exception_ptr for unit testing purpose

I have the system that runs asynchronous network worker and periodically checks if the worker has some std::exception_ptr stored. In this case it might throw, or report an error in some other way. ...
pptaszni's user avatar
  • 6,085
0 votes
0 answers
54 views

How to set a long read timeout for Spring WebClient (to avoid PrematureCloseException)

I have a Spring Boot application with a Spring WebClient sending requests to another Spring-Boot application (Spring-Boot 2.7.14 and Spring WebFlux 5.3.29) WebClient.Builder wcBuilder = WebClient....
THelper's user avatar
  • 15.4k
0 votes
2 answers
61 views

How to get status_code from an exception object

In my code I have a get request as: response = requests.get(url) For invalid status code ie non 2xx an exception is raised, exp_obj = RequestException(response) Now I want to get the status code from ...
Abhiram Devisetti's user avatar
1 vote
1 answer
38 views

Could not find the correct Provider<WelcomeBloc> above this BlocBuilder<WelcomeBloc, WelcomeState> Widget

I solved the error type mismatching from this but now another exception was thrown The argument type 'List<dynamic>' can't be assigned to the parameter type 'List<...
Karthikn's user avatar
0 votes
1 answer
66 views

Why does my error handler doesn't work in asp net?

I'm using a global error handler in ASP.NET Core 7.0: public class ErrorHandlingMiddleware { private readonly RequestDelegate _next; public ErrorHandlingMiddleware(RequestDelegate ...
Winter Wind's user avatar
0 votes
2 answers
90 views

Out of memory exception while decoding message

public static byte[] EncodeMessage(string message) { try { // Convert the string message to a byte array byte[] messageBytes = System.Text.Encoding.UTF8.GetBytes(message); ...
zilon co's user avatar

1
2 3 4 5
1071