Skip to main content

All Questions

Filter by
Sorted by
Tagged with
5 votes
2 answers
180 views

Design By Contract Library in C++

I asked this question on StackOverflow, and got exactly the answer I needed at the time. I am now here to ask - Is this a good design? The motivation for writing up this library: my shop writes ...
jdc's user avatar
  • 153
0 votes
3 answers
198 views

Java exceptions that show the message when converted to String

I’m working with custom exceptions in Java for stack operations. However, I’m unsure if the exception handling is being handled properly, especially in terms of how exceptions are thrown and caught. ...
Somesh Diwan's user avatar
1 vote
1 answer
198 views

Python exception for handling invalid argument types

Greetings One small problem that anyone have to tackle with in Python is handling invalid argument types ( without an automatic static type checking tool like Mypy ) One of the best methods for ...
KhodeNima's user avatar
  • 419
2 votes
3 answers
202 views

Wrap a noexcept C++ library method with a method throwing exceptions with usable explanatory strings to stay DRY

In our apps we're using a shared inhouse library which provides filesystem functions. All the functions are noexcept. In several apps i found that similar or identical error return translations are ...
ridilculous's user avatar
3 votes
1 answer
244 views

Catching the timed out Exception raised by the __init__ method of the class ftplib.FTP

Introduction I have written a Python class which uses the module ftplib. In this class I have created a private method called <...
User051209's user avatar
2 votes
1 answer
171 views

Beginner Java Tic-Tac-Toe

I had a Tic Tac Toe assignment for class and the program seems to work fine but I feel like the exception/input handling could be done in a much better way. Is this a good way to approach the ...
Drosos-kal's user avatar
6 votes
1 answer
497 views

Write a simple, clean error message without a backtrace and exit on failure

I want to write on failure to either STDOUT or STDERR a clean, simple error message for the user, without the (verbose) ...
Timur Shtatland's user avatar
3 votes
1 answer
951 views

Class to wrap result or exception, similar to the OneOf approach

I recently came across the OneOf<T0,...,Tn> package from mcintyre321 via a video by Nick Chapsas, which presents the idea of holding exception types to be ...
JohnLBevan's user avatar
  • 1,409
7 votes
1 answer
234 views

Handling errors in potentially incomplete responses

I am using the library geoip2 to get Geolocation of many IP adderesses ...
Ali Pardhan's user avatar
5 votes
2 answers
2k views

C++ custom exception class

I am wondering, how can I improve this simple MissingResource exception class? I am using it in my simple game. ...
weno's user avatar
  • 209
1 vote
1 answer
228 views

Handling multiple try-catches in a for loop

Good day! I would like to know if this is possible to be refactored into a cleaner code. The reason I'm doing it like this is to catch the column that the error appeared on and then potentially output ...
Chansters's user avatar
4 votes
2 answers
259 views

Reader for graph-file with ugly return and questionable use of streams

I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
Moritz Groß's user avatar
-2 votes
1 answer
151 views

Is it good practice to use try catch only for a part of the code [closed]

When I submit the form, I need to validate the input data from an HTML form field, which comes from the user who submitted the data. So inside the Page_Load event, ...
Adam's user avatar
  • 97
1 vote
1 answer
75 views

Handling errors in an input based program

I wrote a program which creates a svg-group that contains several arranged rectangles with passages inbetween to reach all of the rectangles inside of an area selected by the user. Each rectangle ...
IceRevenge's user avatar
8 votes
2 answers
4k views

See if a specific resource exists in a Kubernetes namespace

I want to have a function that checks to see if a certain resource (deployment, job, cronjob etc) exist in a namespace. Using the Kubernetes Python client, I can create a boolean function (using ...
user3079474's user avatar

15 30 50 per page