Questions tagged [error-handling]

Programming language constructs designed to handle errors signaled by error codes, exceptions or other language specific means.

2
votes
1answer
25 views

Confused about error handling in network layer when implementing MVVM in android, How to notify user something is wrong?

I've been struggling with MVVM pattern and android-architecture-components for last couple of months. In my last project although I did try to decouple some of my app logic but it ended with a lot of ...
0
votes
0answers
5 views

Python 3.7 dataclass: Raise error when assigning a value to undefined attribute

I want to limit the usage of a dataclass to the users of my code and am wondering how can I raise an error in the following context: from dataclasses import dataclass @dataclass class Foo: attr1:...
0
votes
1answer
17 views

How can I show the same page (a form of inputs) with the errors in a restfull api in java?

I have an input form which has many inputs.When click the submit button I want to save the data to my mongodb but check first if the name exist or not.If exist I don't want to save the data and ...
0
votes
0answers
8 views

whats wrong with this code? its producing TLE on spoj

so i tried to solve the problem with my code which according to my calculations should work in the designated time limit link: https://www.spoj.com/problems/CWC2015/ I've tried to optimise it as much ...
0
votes
0answers
11 views

error 25#25: *131 upstream timed out (110: Connection timed out) on AWS Sagemaker

I need help to solve timeout problem when attempting to host a model for inference on AWS Sagemaker. The model is taken from Tensorflow's model zoo (ssdlite_mobilenet_v2_coco): https://github.com/...
0
votes
0answers
15 views

Show errors in an appropriate way for each component

I've created my own global error handling for a react/redux application, but I feel like a bit hacky about it. My problem is, that a user can have multiple components with forms on the screen. For ...
-1
votes
0answers
33 views

Is there any way to convert std::io::Error to failure::error::Error?

I have this code: let file = FileStorage { // ... }; file.write("Test", bytes.as_ref()) .map_err(|e| MultipartError::Payload(error::PayloadError::Io(e)))?; It doesn't really matter in which ...
0
votes
1answer
34 views

How do I combine 2 Error outputs into one

Below enters 2 different lines into my Log: "2019-06-25 16:08:23" "ERROR: " "Copy from C:\Users\Simon.Evans\Documents\Source Data\LNAT\Code_Maping.txt to I:\Dev\BI\Projects\Powershell\Test ...
1
vote
2answers
50 views

How to log without crash in Android?

I have integrated Fabric for crash capturing. But in a special case, I need to just log some details on the fabric. But I didn't find any way to add a log without a crash. Each time I need to crash ...
-2
votes
0answers
6 views

"How to fix windows cannot install required files error code 0x80070570

I have researched every sites for this problem when one of my PC was faced Boot Failure and error popped "windows cannot install required files error code 0x80070570" on Windows Installation I have ...
0
votes
0answers
22 views

How to delete corrupted PDF files created by R when met with error?

I have a for loop that generates a pdf file containing multiple pages of graphs and grobs for each sub-category in my data set using pdf(). Below is a rough skeleton of my code: for (i in group) { ...
0
votes
1answer
18 views

Error event listener not handling load resource errors

I looked everywhere but I couldn't find something that helped. This has been really annoying me because I actually tested what I was doing a few weeks ago and it worked then. So here's my code: var ...
0
votes
6answers
43 views

How to load my placeholder in case of failure to load url?

I'm trying to load an image using Glide. I gave it a url however it results in a FileNotFound exception. However this is not my concern, my concern is that I want to load a placeholder in case any of ...
1
vote
2answers
56 views

Return in an Java exception the content of the line that caused it

I want to write a file log with the errors of a method that reads from a xml file. This method is too large, and I want to control the line content that causes an error. Now I have a variable that has ...
0
votes
0answers
20 views

How to fix 'stderr: kivy.factory.FactoryException: Unknown class <Toolbox>' error in kivy-python

I am trying to build a UI while following the book "kivy interactive applications with python" and I got stuck with this static code which I copied word to word. This is the main file: File name: ...
0
votes
2answers
30 views

How to loop the error trap back to the original question

I have a menu option of 5 things. If the user enters a number not between 1 and 5 my program reasks for the number but even if the user puts in a number that works the program still ends. print(" ")...
0
votes
1answer
49 views

How to handle different error types after boxing them with Box<error::Error>? [duplicate]

In my try to better handle errors and prevent repeating tio much code, I am implementing the ?, operator returning Result<bool, Box<error::Error>> so that I could just match the error once ...
0
votes
0answers
15 views

Output error/warning log (txt file) when running R script under command line for every single day

I have a bat file with following: "C:\Program Files\R\R-3.0.2\bin\x64\Rscript.exe" "C:\Program Files\project\Script\Main_Script.R" >> "C:\Program Files\project\Script\error.txt" 2>&1 ...
0
votes
0answers
26 views

Fix error with writing CSV file for the function fprintf [on hold]

I wrote a code that should save a linked list into CSV file but I get an error for the function "fprintf". I want to save a project of linked lists and I decided to do it with csv text file. typedef ...
0
votes
1answer
16 views

rxjs error handling > on catchError source stops emitting

I'm a bit confused by the rxjs catchError operator. Here is a simple example using Angular: (live demo here) import { Component } from '@angular/core'; import { of, timer } from 'rxjs' import { tap, ...
0
votes
0answers
20 views

Error message in installing github projects

I am trying to install the ggmap latest version package from github using devtools::install_git("dkahle/ggmap") and it shows me this error. Can anyone help me out? Thank you Downloading git repo ...
1
vote
1answer
23 views

using `tryCatch` and printing error message when expression fails

I am attempting to write a custom function which carries out the goodness of fit test using chisq.test (below is a toy version of it). I want the function to be robust so I am using tryCatch to make ...
1
vote
2answers
24 views

prevent sed from writing when encountering error

Is it possible to prevent sed from writing when it encounters an error. Such that sed -e 's/a/b/g' nonExistantFile > fileIDontWantToExist would not create fileIDontWantToExist for example. ...
0
votes
0answers
13 views

files contains error and missing the code over the projects

I am facing this issue is the first time. I was open the project and its start red line of my java class name and I opened the file its all red line in my projects and it hides my code and shows path ...
0
votes
1answer
21 views

How correct catch error when i write to a file?

I have a problem with catching error in module fs exactly writeFile. I tried to try/catch for catch error and write to logs, but it's not working. In debbuger error don't go on catch block, and after ...
-1
votes
0answers
29 views

returning 500 error in flask doesn't work

I am trying to handle a 500 error code in flask and it doesn't return error page I've tried sending a customized error page with render_template and also tried using the abort function but both seem ...
0
votes
2answers
52 views

Error when generating signed APK in Android Studio

Warning:retrofit2.-KotlinExtensions: can’t find referenced class org.jetbrains.annotations.NotNull Does anyone know how to solve this?
0
votes
1answer
19 views

Cannot create new post by hugo from command line

I am using the Hugo KeepIt theme. The configuration is correct as far as I understand. However, running the command hugo new projects/projectsample.md gives the following error: Error: yaml: line 1: ...
1
vote
0answers
7 views

Javascript Float value is considered NaN inside an array [duplicate]

This is a super weird error that's recently been thrown in my console. The actual array I'm logging and what it does is not important because the code still works fine when I avoid using it, but here ...
0
votes
0answers
19 views

Need help to finding error line in Spyder IDE

I use Spyder IDE, but most of the time I can not find the line that the error occurred easily. For example this is one of those errrors: runfile('C:/Users/m/Desktop/python/third.py', wdir='C:/Users/m/...
0
votes
0answers
29 views
+50

How to add my custom error on “/api” documentation api-platform

I'm developping an application with symfony 4 and api-platform, a very awesome package. I created a custom error xxxException, based on https://api-platform.com/docs/core/errors/ . I used it on post ...
-6
votes
0answers
21 views

Browser error when im trying to export data from datatbase through service to child component [on hold]

Im creating social-app project for school. I'm trying to get user data from Firebase through service to child component. All error code, and app code in Link: https://codeshare.io/5QLrbR I can't ...
-1
votes
0answers
42 views

“excel has stopped working” while vba code is running

when I run my vba code by clicking on a command button, "excel has stopped working" keep appearing and the application crashes. I had tried to figure out where the problem is coming from, by pressing ...
-2
votes
1answer
56 views

C++: ScopeGuard vs return check and exception handling?

Consider these code happen in real life. A library code has a function called log_on(), it returns false on fail, true on success, but it has too many false cases. Before return true/false, it needs ...
1
vote
1answer
30 views

Looking to be sure that errors get caught properly in my stored procedure

I'm looking to see if I am able to capture my errors correctly in this stored procedure: ALTER PROCEDURE [dbo].[sp_UpdateText] (@aID AS INT, @CompanyID AS INT, @CompanyName AS VARCHAR(...
0
votes
1answer
15 views

How to fix MissingPermissions error not working | discord.py

I've set up a *ban command and it uses the @commands.has_permissions(ban_members=True) decorator. However, my error-handler doesn't seem to pick up on if isinstance (error, MissingPermissions):. @...
0
votes
2answers
55 views

Python Runtime Error not working as expected

I have an input file as follows 3 01 0010100 11011 and the output is supposed to look like this LIVES DIES LIVES However my code returns, DIES [1, 0] DIES [0, 1, 0, 0, 0, 1, 0] DIES [1, 1, 0, 1, ...
0
votes
0answers
24 views

Keep receiving error: “Cannot bind parameter 'Headers'”

Everytime I try and send my parameters over to Invoke-RestMethod I always receive the error: Cannot bind parameter 'Headers'. Cannot convert the "{ "Content-Type": "application/json", "...
0
votes
1answer
28 views

Intentionally create new error in Javascript to check code behavior

In order to test how the front-end responds to various HTTP status error codes, I want to intentionally return an Error from one of my front-end service methods to simulate an Error from one of the ...
0
votes
0answers
20 views

Manage error handling with seedstack and undertow

I need to manage HTTP errors, by seting up a generic error message, in order to hide server side errors in the HTTP response. I'm using Seedstack and the embeded server undertow. I've found how ...
0
votes
1answer
31 views

How to prevent blank page in react on http errors

I see blank page in react application when the axios receives 503 (Service Unavailable). I understand the issue. When there is 503 (service Unavailable) error, component unmounts and eventually ...
1
vote
1answer
30 views

How Expressjs decides which error handler to call. if we have multiple error handles

I am just curious to know that how express decides which error handler to call (next(err)), when we have multiple error handlers.
0
votes
0answers
9 views

How to Handle Connection Issues that Occur in Other Threads

I am currently using ZeroMQ to create a utility that will allow me to publish objects to a sort of workspace that can be seen on a network. I'm planning on using it in small LAN networks to easily ...
1
vote
1answer
39 views

Should all HTTP error responses have the same JSON structure?

We are developing a REST service with Spring Boot and got stuck wondering if every error response should have the same JSON structure? For error cases our service responds with a simple JSON format. ...
0
votes
1answer
25 views

Is there a way to determine which element is causing a deserializing error in .net

I am importing data into our program. I have a style sheet that transforms the incoming data to match our entity framework. I am getting an error when de-serializing the transformed data into our ...
0
votes
0answers
16 views

request-promise within a try catch block

I am seeing an issue when using the request-promise library in which i am not able to capture the error in the respective catch block. async function doWork() { try { let resp = await rp(...
0
votes
1answer
14 views

How to execute code, and re-execute code if server stops responding?

I am trying to scrape data from the website http://lmi2.detma.org/lmi/lmi_es_a.asp and occasionally the website stops responding. This causes my code to continue running without doing anything. I want ...
0
votes
0answers
9 views

predictMeth (Biseq) error in sendmaster(try(eval(expr,env),silent=true))

I am doing Biseq DMR analysis and reached to plotMeth function. I've runned this script many times before without problem, but now I get a weird error, that I can't seem to understand or solve. ...
0
votes
1answer
20 views

Handle exception in python program-wide without try-except block

There is a way to declare a sort of "global handler" that can catch Exceptions (custom and default one) in any place of the code? Like a general handler that make some operation if a certain kind of ...
0
votes
0answers
9 views

jbpm console run failure

I am a new user of Jbpm .I am trying to install and run the Jbpm 7.22.0 Final full installer and I tried to start the Service. while the starting jbpm-console give following Exception. May any one ...