Skip to main content
Filter by
Sorted by
Tagged with
-6 votes
1 answer
98 views

I have this method in my program, it is meant to register the gender of the user for later on in the program (with Male and Female as the only valid options): public static void Main(string[] args) { ...
Matto's user avatar
  • 1
0 votes
2 answers
87 views

My question is similar to this one but that returns the error, and this one which has no answers. I want to catch errors (returning NA) and warnings (returning NaN) but saving the warning message for ...
Earlien's user avatar
  • 307
-1 votes
1 answer
167 views

I was wondering how was the correct usage of the try execpt/execpt(err) function in python and why it's raising up this error UnboundLocalError: cannot access local variable 'player_move' where it ...
aPythonDude's user avatar
2 votes
1 answer
91 views

C# .Net Framework 4.8. I am using CryptoStream Reader to decrypt an encrypted datastream within a Using {} block. If the Key used for decryption is incorrect, the CryptoStream Reader throws an ...
Himilou's user avatar
  • 177
-1 votes
1 answer
69 views

I have a controller method which I am using to change the status of the row data in the database. But I forget to mention status field in the model file. So the status was not changing in the database....
nischalinn's user avatar
  • 1,284
-2 votes
1 answer
197 views

I'm working on a Java utility. This utility should read some input files (one or several). Each input file contains three types of strings, representing an integer, a float, and a string. The utility ...
longpastgone's user avatar
1 vote
1 answer
49 views

I have a code that produces an error (see freq(x = r, zone = p)) : Error in `$<-.data.frame`(`*tmp*`, "zone", value = 1L) : replacement has 1 row, data has 0 But when using tryCatch(),...
M. Beausoleil's user avatar
0 votes
1 answer
129 views

I use invoke-webrequest to wait until the API of a program is running and to get an id back from the response of this request. The program takes some time to startup so before the request is posted ...
Tom Wolf's user avatar
1 vote
1 answer
141 views

I am using Google Apps Script to fetch data from an external URL. When the request is successful, I can get the HTTP status code with HTTPResponse.getResponseCode. However, if the request fails with a ...
Stevoisiak's user avatar
  • 27.8k
0 votes
0 answers
32 views

So, I'm currently having a lot of trouble trying to change the text and color of a certain element. Here is my code: <!DOCTYPE html> <html> <head> <link rel="icon&...
SubnauticaFan's user avatar
1 vote
1 answer
188 views

I have a rmarkdown setup to take input of csv data and saves results in xlsx and word file. I am rendering the rmd file within trycatch to save the warnings created within in a log file. But looks ...
Sandhya Ghildiyal's user avatar
3 votes
1 answer
110 views

The following code works (i.e. returns the expected data from the registry), however it throws a non-terminating error due to a lack of permissions to one of the target key's subkeys, which is benign ...
mmseng's user avatar
  • 959
0 votes
2 answers
109 views

In method setPhoneNumber how can I re-throw throw new InvalidPhoneNumber("Номер телефона должен состоять только из цифр") so that it could be caught as InvalidPhoneNumber? public class App { ...
Альберт Александров's user avatar
0 votes
1 answer
274 views

I am currently working on a websocket server to allow communication between 2 computers, and I'm coding the communication between PC and server. I made a command to stop the server remotely, but when ...
Stardaz's user avatar
  • 15
0 votes
0 answers
177 views

I have multiple layers of nested stored procedures, each with a try...catch block within them. However, I want each of these nested stored procedures to be able to properly run their own transaction ...
Leah's user avatar
  • 345
1 vote
1 answer
98 views

So I'm doing a tutorial which contains a part about asynchronous JavaScript. I feel like I have it down pretty good, but it includes this section which I feel like is wrong for catching errors? ...
geckels1's user avatar
  • 644
-1 votes
1 answer
151 views

I'm using Symfony\Component\Mime\Email to send emails with try/catch. Locally when the smtp server (mailhog) is down the try/catch works well. But in prod, if the smtp is down, the page loads for ...
Sami's user avatar
  • 785
1 vote
1 answer
65 views

On a particularly deep directory, the code: $files = Get-ChildItem -Path $d.FullName -File -Recurse -ErrorAction SilentlyContinue is resulting in Get-Childitem : The script failed due to call depth ...
pteranodon's user avatar
  • 2,059
0 votes
0 answers
36 views

const getLocation = () => { const result = requestLocationPermission(); const options = { enableHighAccuracy: false, timeout: 5000, maximumAge: 10000, }; result.then(res ...
Hassaan's user avatar
1 vote
1 answer
49 views

A LeetCode problem which is about linked lists that goes with this structure: # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = ...
Yanal Nasir's user avatar
0 votes
0 answers
53 views

I'm using Ant design's Upload Component in my code to enable file uploading and replacing. Following are the props I've defined: const uploadProps = { beforeUpload: async (file) => { // ...
Muhammad Fuaad's user avatar
2 votes
1 answer
86 views

I don't anderstand the behaviour of the try ... with ... feature of OCaml. here is a little sample to reproduce my problem : let () = try int_of_string "4" with | Failure -> -1 | n -...
Jaja's user avatar
  • 60
0 votes
2 answers
415 views

After a computer crash and reinstallation of C++Builder 12.2 on a new computer, some code doesn't compile any more. For example: void __fastcall TSynCustomExporter::CopyToClipboardFormat(UINT AFormat) ...
dmeltz's user avatar
  • 31
0 votes
1 answer
147 views

I'm trying to bridge a Rust-based networking layer written with uniffi-rs to my Swift-based Xcode project. It has some weird type of system now, but I have this until I figure out something else. I ...
Seto's user avatar
  • 1,722
1 vote
1 answer
179 views

I am currently working with JPA. I’ve encountered an issue during development. Here’s the current situation: itemService addItem: If the item is already owned, an exception is thrown. If the item is ...
chaiJeon's user avatar
0 votes
1 answer
214 views

I stopped an instance I call using rest template to be able to catch the errors thrown. The errors are: org.springframework.web.client.ResourceAccessException: I/O error on POST request for Caused by: ...
MxS's user avatar
  • 1
0 votes
1 answer
56 views

I have a mysqli call ($result = $this->mysqli->query($query)) in which $query is an insert statement that generates the error: "Duplicate entry 'dt' for key 'username_UNIQUE'";. I ...
Nikkorian's user avatar
  • 800
0 votes
1 answer
61 views

In the following code, private bool AuthenticateUser(string userName, string password) { try { using(var entry = new DirectoryEntry("myLDAP", userName, password)) { // ...
Alan's user avatar
  • 21
1 vote
1 answer
107 views

async function all(...params) { let result = []; for (let promise of params) { try { let res = await promise; result.push(res); } catch (e) { result.push({ error: ...
Kunal Thakur's user avatar
1 vote
1 answer
66 views

I'm using mockito to write test, but I'm really struggling with how to test this specific bit of code: public void myMethod() { try { Thread.sleep(400); } catch (InterruptedException e) { throw new ...
CodingAllTheTime3's user avatar
0 votes
2 answers
216 views

I work with code which looks similar to: try { f1(); f2(); f3(); } catch(Exception) { //... } If in Visual Studio I set a breakpoint within the catch block, is there a way for me to ...
user1079505's user avatar
1 vote
2 answers
65 views

In my ArrayQueueTest.java file, I can't seem to figure out what's going wrong. I get the same error, which is unreachable catch block for IsEmptyException and IsFullException I have tried everything ...
Ryan Hansen's user avatar
0 votes
1 answer
75 views

I am writing code that reads files, parses them, and stores the data into a database when a user clicks a button. I have separated each operation into functions within multiple classes, but many of ...
Dean Lee's user avatar
  • 147
2 votes
1 answer
71 views

I am trying to create a gt table with cropped headshots of baseball players, however there is no image available for one player (Cameron Sisneros) and this causes an HTTP error 404. Ideally, absence ...
Violin125's user avatar
  • 163
0 votes
2 answers
112 views

Code coverage tells me that catch statement is not covered in the code below. This is old code, and I'm not sure why it's written this way. How do I test it? Is it even possible? Could potential ...
sam sergiy klok's user avatar
1 vote
1 answer
166 views

I have a larger use case that I narrowed down to the following code snippet. This code might not make a lot of sense however this is just to demonstrate the issue I have. I am trying to catch the ...
ryan's user avatar
  • 11
2 votes
0 answers
129 views

I'm working on an upload/download function in R Shiny for saving and retrieving user inputs into data frames and other table objects. Files are locally saved to the user machine. I'm using tryCatch() ...
Village.Idyot's user avatar
0 votes
0 answers
108 views

Firstly,the CAN device receives message,and calling the following method private List<string> recordList = new List<string>();// private List<string> recordList1 = new List<string&...
Lan's user avatar
  • 11
1 vote
2 answers
54 views

I have a JSON object, some keys of which have names end in .json, like this: { "a.json": "...", .... } The "..." can be either a string which fromjson can decode,...
Tamás Horváth's user avatar
1 vote
1 answer
101 views

I have a text document with an list of numbers experated by "|". Ex: 0|0|2 1|0|1 1|1|0 2|0|1 2|1|0 2|2|1 3|0|0 3|1|1 3|2|0 3|3|1 I am generating this though code and all ways have an extra ...
George Volz's user avatar
0 votes
1 answer
80 views

I'm trying to catch an exception that occurs in my code line var excel = Excel.decodeBytes(bytes); but the error is not caught. The compiler stops at the line and shows: Exception: StateError (Bad ...
NickNefyodov's user avatar
0 votes
2 answers
342 views

/* the code that is doing the API call, account.get() is an endpoint provided by Appwrite to get current user session data */ export async function getCurrentUser() { try { const user = await ...
Pratik Kumar Patra's user avatar
1 vote
0 answers
73 views

So I am self-taught and green on handling requests, but it seems to me that in the case of no request body, the BufferedReader should output null if I call .readLine() again after running this kind of ...
T-Stone's user avatar
  • 11
0 votes
2 answers
432 views

I am adding a store method to a controller that will create and save a new model to the database using the following code: public function store(Request $request) { $validated = $request->...
Hoyt Jolly's user avatar
0 votes
1 answer
40 views

I need this to rerun the initial inpput question if it gets a value that is unacceptable. try: hours = float(input("Please enter your hours worked: ")) if hours < 1 : ...
Jennifer Sigler's user avatar
0 votes
1 answer
54 views

I have three layers in my application Controller, Service and DAO. My controller and service layers are in spring meanwhile DAO layer is in Hibernate 6. My question is what is most appropriate way to ...
Yasin Ahmed's user avatar
1 vote
0 answers
183 views

I have come across an interesting case, where C++ gives me a bus error, when I am trying to catch an exception. I created a minimal example to reproduce the error: #include <iostream> using ...
RolandSt's user avatar
0 votes
0 answers
63 views

I have a need to attempt to convert a date from the registry to a [Datetime] so that I can do operations with it, and the date format is variable, because Autodesk. I also need to be able to throw ...
Gordon's user avatar
  • 7,027
2 votes
1 answer
123 views

I am looking for a function/code that returns the current exception object. In other words, the exception object that represents the exception currently being handled (by the catch block). For example:...
Александр Кулагин's user avatar
0 votes
0 answers
71 views

try { var appcontrolHeartbeat = new Class1(); } catch (FileLoadException e) { log.Info( $"...
Kim Oppalfens's user avatar

1
2 3 4 5
177