Questions tagged [error-checking]
The error-checking tag has no usage guidance.
144
questions
0
votes
2
answers
39
views
Is there any way to check if there is any input then contiue?
I am a newbie in bash programming. I need a bash script which can check if there is an input or not.If there is an input then continue to the second question, otherwise it will not continue unless it ...
0
votes
1
answer
35
views
Double check on columns from two DataFrame
I have an issue implementing a check from a column of one DataFrame to a column of a different DataFrame. I have two Data Frame, one is the child of the other. First one has index with info of surface ...
2
votes
3
answers
221
views
Go errors: Is() and As() claim to be recursive, is there any type that implements the error interface and supports this recursion - bug free?
Everywhere I look, the "way" to "wrap" errors in Go is to use fmt.Errof with the %w verb
https://go.dev/blog/go1.13-errors
However, fmt.Errorf does not recursively wrap errors. ...
0
votes
0
answers
55
views
how can I check if an entry already exists before its captured
I would like to validate an entry before it adds as a record by checking the student ID in "UserForm" against an array in "SDB" and if it finds a match to pop up with an error. At ...
0
votes
1
answer
118
views
node.js client side errors not showing in console
I am on a school Chromebook, where developer tools are disabled. I sometimes coded on node.js, having server-side and client-side code. But, as developer tools are disabled, I can't check errors on ...
0
votes
1
answer
59
views
C error handling: if error return int code else value?
In Go they often do the whole (err, val) thing, in Rust they do similar (+ syntactic sugar).
I'm not sure if I should have this type of struct for each of my types:
typedef struct {
int status;
...
0
votes
3
answers
58
views
How do I check for error in Python to stop it from looping?
I am a beginner Python learner. This keeps looping and I couldn't seem to find the error in this to get it corrected. Any help would be appreciated. Thanks.
sentence = "that car was really fast&...
0
votes
1
answer
116
views
Writing to file using setvbuf, conditionally discard buffer contents
I would like to write a simple API which
allows the user to open a file.
let the user write data to the file
track the write calls and sanity check the written data after each write call.
prevents ...
2
votes
3
answers
207
views
Is there a way to raise a compile time error when calling a given function several times in C++?
Is there a way in C++ to design a function / add some "attributes" to it in such a way that calling it several times in the code would raise a compile time error?
To give a bit of background ...
0
votes
1
answer
47
views
Try and Catch InputMismatchException: Error Checking Integer - Logic Incorrect
I am trying to create a method for error checking input using a try and catch statement with the catch InputMismatch. It is not working can anyone advise why my return statement is not returning the ...
0
votes
0
answers
23
views
Excel to check date in clipboard before proceeding
I am trying to come up with a code that will check the users clipboard to ensure that the first value in the clipboard is a date. If not then exit the sub before proceeding. The problem I am having is ...
0
votes
1
answer
65
views
How does Intellisense decide to which project a file belongs to?
I have two CMake projects in Visual Studio 2019 which are completely seperated and have nothing to do with each other.
If i open the first one with the "Open Folder" option and go to my main....
1
vote
1
answer
194
views
checking if this is a source package ... ERROR
Dears, I'm working in an R package and when I check the package with devtools::check, next note and error are arising to windows and Debian systems:
checking CRAN incoming feasibility ... NOTE
...
0
votes
1
answer
103
views
google apps script - how to exclude part of the code which returns error (502 Bad Gateway)
I've got a code that scraps few websites using UrlFetchApp.fetch and JSON.parse methods. Lately I'm getting a lot of errors when one of the websites is down so the whole code stops from execution.
...
0
votes
3
answers
50
views
Console is being flooded when error checking for things that are not an int
I'm trying to only allow integer values into my program, so I've made the following function. The function is similar to other ones I've seen online, and mine seems to work just fine up until I add an ...
0
votes
1
answer
69
views
How to retry only error-producing line in a function
This is quite tricky to explain, but I'd like to know if there is a way to repeatedly retry only the line of code that produced the error until it works. For example say I have the code:
def ...
0
votes
1
answer
37
views
Partial input verification
I'm trying to implement input verification in my code.
I'm using .ignore(), as well as .clear().
The input is rejected as it should be when there is anything else than a number in the forefront of the ...
0
votes
1
answer
30
views
trouble setting default values in a function[r]
Info:
I am working in R with the state information package "state.x77"
Goal:
I am finding correlations between the independent variables and the dependent "Life expectancy".
Issue with code:
I ...
1
vote
1
answer
49
views
C++ how to prevent invoking a method more than one in Compile-time?
I have a method and I want to force the user calling it at last one in compile-time.
Currently I have a correct implementation, But it is useful for runtime execution.
Is there a clean way to ...
0
votes
1
answer
17
views
Is this a correct way in python to find out the that a specific name is in the string for how many max no of times continously
Program for finding a specific name that is in continous no of times. E.g 'yaweryaweryaweraliyawer' here yawer is for 3 maximum no of times continously.
##Created a string to checking for a specific ...
-2
votes
1
answer
491
views
How do I check if an int is evenly divisible by another int?
I'm trying to write a program that checks if an integer is divisible by another integer: 8 and 2 or 8 and 3. I'm using if statements. This is what I have so far:
if(int1 / 2)
{
printf("2:yes \n");...
0
votes
0
answers
38
views
How does one do checksum verification of network transmitted data
I am makign my own 'protocol' where I have to design the header. I understand how to verify the integrity of the first header I sent..
What I'm confused about is how does one verify the integrity of ...
0
votes
1
answer
61
views
Trouble adding correct error checks to code
For my assignment I was given a program to add error checks to, I was add the first two quickly (any comment with an X after it I believe I've solved) However I believe the problem for this error ...
0
votes
2
answers
141
views
why we found ULL in the end of patterns used for memory testing? [duplicate]
What is the utility of adding ULL in the end of patterns written to test the memory ?
For Exemple
uint64 pattern_55 = 0xAAAAAAAAAAAAAAAAULL;
static error_t sram_aa_55_test(uint32 start_address, ...
1
vote
1
answer
369
views
How can I pipe stderr and still test if the command failed?
I would like to write a one-liner for cron that will:
Redirect STDOUT and STDERR to logger
Test if the command fails
Perform an action if that happens
I have a script that will print some things and ...
0
votes
1
answer
41
views
How to conventionally check for ValueError in python?
I've used a while True: loop alongside try and except statements to error check a program I've handed in for my university assignment. Upon receiving my grade, I've been marked down for using a True ...
1
vote
3
answers
1k
views
How to detect a button.click() failure in Selenium?
I have a Selenium 3 Python script that is used to file FTC complaints for nuisance calls. Today a miscreant got through using the number "0" (literal 0). The FTC website rejected the number but my ...
-1
votes
2
answers
48
views
Why this code doesn't work and how to repair it?
I wrote a code, this is simple program with 2 inputs and print. I add some code to prevent that name and year are correct. When data from inputs are correct my program works correctly but when its not ...
5
votes
4
answers
328
views
Checking if an array is 'right' (C++)
A right array
Let's assume we have an array with an N length, made of capital
letters A, B, and C. We call the array 'a right array' if between
every two C letters which come one after ...
1
vote
1
answer
653
views
Automatic code checking for python works incorrect
I try to check my code using special configuration
.pre-commit-config.yaml
repos:
- repo: https://github.com/ambv/black
rev: 'stable'
hooks:
- id: black
args: [--py36, --line-...
-1
votes
1
answer
284
views
PHP get_headers() result distinguish [closed]
I use the function get_headers( $url).
If according to http://php.net/manual/en/language.types.boolean.php an e,pty string equates to false.
How can I distinguish between the function returning ...
1
vote
1
answer
76
views
Why does my .java file disable errorchecking?
Recently I've added a .java file to my Processing Project (its called GClip.java from a library which is called G4P). That .java file helps to copy stuff to the clipboard. I read that on a forum, ...
0
votes
1
answer
21
views
Making a double selection sort method, and my code refuses to pass tests, even when nothing seems wrong
This is part of a final project form my data structure and algorithms class; I've tested it over and over, gone over the code numerous times, even going so far as using dice to simulate randomly ...
0
votes
1
answer
111
views
VBA to search a specific worksheet for errors and pass back result to main macro
I need a macro which will search for formula errors in a specific worksheet in a workbook. This needs to work in multiple different workbooks with different worksheet names in each book. Once it has ...
0
votes
2
answers
573
views
Is there a way to error checking of Robot framework testdata
Is there any way by which error checking can be done for the robot framework test data (testcases and keywords).
RIDE displays red color if there is import error, or a required argument is not passed....
0
votes
1
answer
3k
views
Powershell Windows Form listbox selection validation
I have created a powershell script using windows forms containing list boxes to run a cmd command (helps eliminate user-error and expedites process a bit). The only problem I run into is the command ...
1
vote
1
answer
61
views
Check Valid Time in Userform
I am trying to error check in a userform where I want to be able to check that the time that was entered is a valid time expression (00:00 or 00 PM) as I am sending it through a TimeValue command for ...
1
vote
2
answers
90
views
C++ best practices for running other programs from within 'main'
So I have a short program that has to run a few other programs and wait for them to complete.
Currently I am doing this in my main method like this:
// Connect to the service
cout << "Starting ...
2
votes
2
answers
5k
views
Print to R console from within function
I want to modify the behavior of console printing within an R function, to get back the same behavior as in the global environment.
Much as you can call browser() to enter the function environment ...
0
votes
1
answer
66
views
Problems Error Checking Code
import java.util.*;
public class AccountClient {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner input = new Scanner(System.in);
boolean infiniteLoop = ...
2
votes
2
answers
5k
views
How to catch or handle CUDA kernel launch errors
I use the checkCudaErrors helper function from the CUDA Toolkit Samples. See "helper_cuda.h". I am perplexed as to why the launch error from this example is not caught by checkCudaErrors. The error ...
0
votes
1
answer
122
views
Error checking: like checking for negative numbers, or input that's not a number.
weight=input('What is your weight?')
age=input('What is your age?')
w=int(weight)
a=int(weight)
if (a<=10 and w<80):
print('This person needs to ride the black roller coaster')
if (a<=10 ...
2
votes
0
answers
1k
views
How to detect if AWS has sufficient capacity to launch r4 instances
We keep running into this insufficient capacity way too often when we launch our cloudformation to create test environments. I've not found a way to proactively check if AWS can provide capacity to ...
6
votes
1
answer
2k
views
Passing size as argument VS assuming shape in Fortran procedures
I'm trying to decide which one of these two options would be the best:
subroutine sqtrace( Msize, Matrix, Value )
integer, intent(in) :: Msize
real*8, intent(in) :: Matrix(Msize, Msize)
real*...
1
vote
0
answers
203
views
Error checking on stdout: is "relying on ferror" an alternative? [duplicate]
Does ferror() aggregate all errors of previous fputc(stdout), fputs(stdout), putc(stdout), putchar or puts calls?
At least when not using wide strings?.. (Nor printf().)
If it does then may it be an ...
0
votes
2
answers
161
views
How to make Visual Studio wait for me to compile before complaining about declared but never used variables
How to make Visual Studio wait for me to compile before complaining about declared but never used variables?
CS0168 The variable '_' is declared but never used
Yes Visual Studio, ofcourse it's not ...
0
votes
1
answer
3k
views
FFmpeg Error Checking
I have three example videos, good.avi, damaged1.avi, and damaged2.avi. The first will play in VLC, but the second two both error with the same "Broken or missing AVI Index" message.
I have thousands ...
-1
votes
1
answer
45
views
C++ basic converting and then adding up user inputs
This is my attempt at a solution I wrote for an exercise in Bjarne Stroustrup's Programming Principles and C++ book. Unfortunately, the section I wrote to give the total amount of money from the coins ...
2
votes
1
answer
569
views
How can I turn background error checking off for the Excel app object in EPPlus?
Using the unwieldy and ponderous but full-featured Excel Interop, background error checking can be toggled off like so:
Excel.Application excelApp = new Excel.Application();
excelApp....
-1
votes
1
answer
393
views
In c++, how do I check if there was more than one inputs? [closed]
For example, a user enters two inputs instead of one, how do I detect that and output an error message?